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.
This page covers the token and cost profile of agentic-assisted programming (human-guided, tool-augmented loops), not fully autonomous coding.
Source: token-cost-breakdown.md. Measured story: Rocky value report.
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:
graphify update . --wiki(when the CLI is installed)- Read
graphify-out/GRAPH_REPORT.mdand the wiki index graphify queryfor 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.
| Metric | Current state |
|---|---|
devkit-start-task prompt | Compact router prompt (no full 37-URI embed) |
list_handbook JSON (if called) | About 6,400 chars (about 1,600 tokens) |
devkit-review-code prompt | Fixed 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)
| Step | Relative cost |
|---|---|
codebase-discovery + 1-2 agent/rule reads | Low |
list_handbook (only if URI unknown) | Medium (about 1.6k tokens) |
| Graphify wiki skim | Medium (one-time per repo) |
| Implement feature | High (your code) |
pre_pr_quality_gate | Medium |
repo_open_pr | Low |
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.
