Zheat Logo

    Agentic-assisted programming: token and cost breakdown

    One gateway vs many MCP tools, graphify before grep, pre-PR gate vs rework loops, and how Rocky keeps handbook overhead around 4-6k tokens when you follow the router.

    Follow on LinkedIn

    This page covers the token and cost profile of agentic-assisted programming (human-guided, tool-augmented loops), not fully autonomous coding.

    One gateway vs many tools

    Listing dozens of MCP tools burns context on schemas. Rocky exposes a single devkit tool with an action field. The model learns operations from devkit://capabilities once, then reuses one schema.

    Tradeoff: each call still sends the full devkit schema. On long sessions that is usually cheaper than 15+ separate tool definitions.

    Graphify before grep

    Reading every file to "understand the repo" is expensive. Graphify-first workflow:

    1. graphify update . --wiki (when the CLI is installed)
    2. Read graphify-out/GRAPH_REPORT.md and the wiki index
    3. graphify query for targeted questions

    Savings: fewer full-file reads, better structure awareness, fewer wrong edits.

    Pre-PR gate vs rework loops

    pre_pr_quality_gate runs lint, tests, and review heuristics once. It costs tokens up front.

    A typical rejection loop costs more: review comments, fix, push, re-review, context reload.

    Rule of thumb: one gate run before PR is cheaper than two review rounds caused by style or lint failures.

    Prompts: devkit-start-task

    Inlining all handbook URIs in the prompt duplicated list_handbook and nudged models to fetch too many resources.

    MetricCurrent state
    devkit-start-task promptCompact router prompt (no full 37-URI embed)
    list_handbook JSON (if called)About 6,400 chars (about 1,600 tokens)
    devkit-review-code promptFixed 3-resource guidance

    Typical good path: devkit-start-task + how-it-works + codebase-discovery + 2 agent/rule reads. About 4-6k tokens of handbook overhead.

    Avoid: list_handbook plus reading 10+ agent bodies (about 10k-25k+ tokens).

    Example session (rough)

    StepRelative cost
    codebase-discovery + 1-2 agent/rule readsLow
    list_handbook (only if URI unknown)Medium (about 1.6k tokens)
    Graphify wiki skimMedium (one-time per repo)
    Implement featureHigh (your code)
    pre_pr_quality_gateMedium
    repo_open_prLow

    Use structured: true on intelligence tools when the host parses JSON. That avoids re-parsing markdown.

    Standalone tools

    Inspector and debug tools (project-intelligence, pre-pr-quality-gate, etc.) duplicate gateway actions. Prefer devkit in chat. Use standalone tools only for testing.

    Related