Tokenomics, in the context of agentic software engineering, is the quantitative measurement of how computational resource units—tokens—are distributed across the logical phases of an autonomous system. It is not about cryptocurrency; it is the core physical metric that determines whether a multi-agent system is financially and operationally viable in production. In my experience building production-grade automation systems, the naive promise of "autonomous digital workforces" often collapses when faced with the harsh reality of escalating API bills and execution latencies. We cannot build reliable systems without understanding exactly where our tokens are spent.
To run these systems at scale, we must move beyond qualitative impressions and analyze empirical trace data. A recent study by Mohamad Salim and colleagues, titled Tokenomics: Quantifying Where Tokens Are Used in Agentic Software Engineering, provides the exact empirical baseline we need. The researchers analyzed execution traces from 30 software development tasks performed by the ChatDev multi-agent framework using a GPT-5 reasoning model. By mapping the framework's internal phases to the classic Software Development Life Cycle (SDLC)—Design, Coding, Code Completion, Code Review, Testing, and Documentation—they quantified where the computational budget actually goes.
The findings reveal two major structural inefficiencies that every applied AI engineer must address.
The code review tax
First, the study demonstrates that the iterative Code Review stage accounts for an average of 59.4% of all consumed tokens. This is a massive trade-off. In a naive system design, one might assume that "Coding"—the raw generation of syntax—would be the primary cost driver. In practice, writing boilerplate code is computationally cheap. The real expense lies in automated verification, alignment, and refinement.
When agents review code, they enter highly recursive loops. They inspect the output, identify syntax errors or logical edge cases, draft corrections, and re-evaluate. This recursive behavior is necessary for high-quality software, but without strict optimization, it becomes a financial black hole. If nearly 60% of your token budget is consumed during review, your primary optimization target should not be the generation model; it must be the verification pipeline.
The input token bottleneck
Second, the researchers found that input tokens consistently constitute the largest share of overall consumption, averaging 53.9% of the total token count. This is a direct consequence of how multi-agent frameworks are engineered. In a typical chat-based agentic setup, agents communicate by passing messages back and forth. With each turn, the entire conversation history, system instructions, and the current codebase are fed back into the model as input context.
This leads to quadratic context growth. We are effectively paying a massive "context tax" just to remind the models of what has already occurred. In a production pipeline, this level of redundancy is unacceptable. It increases both the API costs and the processing latency, degrading the user experience.
What this means in practice
When we designed our legal automation platform, Mandamus & MOA, which automates complex, court-ready drafting from massive files, we observed the exact same structural constraint. High-context, multi-phase document drafting mirrors the SDLC. If you naively pass entire histories between drafting and auditing agents, your input tokens scale exponentially, and your system's unit economics fall apart. We had to move away from conversational message-passing toward a centralized state-management architecture.
Based on these empirical insights and my own implementation experience, there are three practical architectural remedies we must deploy in production systems:
Decouple state from communication: Instead of letting agents pass raw chat histories, store the active state—whether it is a codebase, a legal draft, or a set of configurations—in a structured database like SQL Server. Agents should query and update this centralized state via minimal, well-defined APIs. This prevents the exponential accumulation of context in the prompt history.
Aggressive context caching: If your API provider supports context caching, use it. Since 53.9% of the tokens are input tokens, caching the system instructions, repository schemas, and historical context can cut running costs significantly. For systems running continuous loops, this turns a variable cost into a predictable, highly managed infrastructure expense.
Asymmetric model tiering: Do not use your most expensive reasoning models for every phase of the pipeline. Writing documentation, parsing basic inputs, or generating initial boilerplate can be delegated to faster, cheaper utility models (such as Gemini 2.5 Flash or local models via Ollama). Reserve the high-tier reasoning models solely for the critical 59.4% review and verification phase, where complex logic and multi-step validation are genuinely required.
Ultimately, agentic engineering is a resource allocation problem. To build sustainable systems, we must treat token consumption with the same engineering rigor we apply to memory allocation or network bandwidth. Only by optimizing these operational profiles can we move agentic software engineering from an expensive experiment into a reliable, enterprise-ready utility.
Sources
- [2601.14470] Tokenomics: Quantifying Where Tokens Are Used in Agentic Software Engineering — Manual / ad-hoc · 2026-06-10