Tokenomics: Quantifying Where Tokens Are Used in Agentic Software Engineering
TL;DR Highlight
Analyzing 30 ChatDev tasks showed code review consumes 59.4% of tokens
Who Should Read
Backend or platform developers struggling with unpredictable token costs in multi-agent coding pipelines
Core Mechanics
- Code review eats 59.4% of tokens
- The authors analyzed execution traces of 30 development tasks run on ChatDev with a GPT-5 reasoning model.
- The Code Review stage averaged 59.4% of all tokens, the largest share.
- Input tokens average 53.9%
- Comparing input, output and reasoning tokens, input was the largest share.
- The authors take this as evidence of possible inefficiencies in agent collaboration.
- Cost comes from verification, not generation
- They conclude the main cost is in automated refinement and verification rather than initial code generation.
- They provide a stage-by-stage measurement method
- ChatDev phases are mapped to Design, Coding, Code Completion, Code Review, Testing and Documentation.
- The authors say this helps predict costs and optimize workflows.
- Results are preliminary
- The paper itself calls them preliminary findings.
- It covers one framework, ChatDev, and 30 tasks.
Community Reactions
- Experience that input dominates
- One commenter sees roughly a 10:1 input-to-output ratio in their own usage.
- They say an agent may read a million tokens just to patch one line.
- Opinion that small sample still matches practice
- A commenter first thought 30 tasks was few, but said code review consuming most tokens matches what they have seen.
- Experience of unaccounted AI costs
- A commenter saw a single simple query burn 250k tokens in a product demo.
- The vendor could not say whether the license had a token budget cap.
- Experience of Copilot running out of tokens in two days
- After a pricing change, one commenter ran out of tokens in two days and called token pricing arbitrary.
- One commenter pointed out that Tokenomics already refers to crypto economics.
How to Apply
- Break down tokens per stage from your agent logs today
- Collect the usage fields from 20-30 recent agent runs and sum them by stage (generation, review, testing).
- Record input, output and reasoning tokens separately to see which is largest.
- Cap review loop iterations
- Set a maximum number of review-fix rounds and stop when exceeded.
- Compare token usage and pass rate before and after the cap.
- Start optimizing by shrinking input context
- Input is the largest share, so pass the review stage only changed parts of files and history.
- Compare cost on the same tasks before and after.
- Add per-task token budget alerts
- Log total tokens per task and send an alert when it exceeds a threshold.
Try It
# Paste into Claude/ChatGPT (simplified version of the paper's method: per-stage token analysis)
Below is my agent run log. Classify each call into Design, Coding, Code Completion, Code Review, Testing, or Documentation, and make a table of input/output/reasoning token totals and the percentage of overall usage per stage.
Then pick the stage that uses the most tokens and suggest 3 ways to reduce its input tokens.
Log:
{{agent run log or usage JSON}}Terminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls