
<p><b>Key facts.</b></p>
<ul>
<li>In a naive agent loop, every call re-sends the conversation so far, so cumulative cost grows roughly with tokens times the number of calls, not linearly with steps. In one real coding session cache reads were 87% of the total cost by the end, and crossed half the cost at 27,500 tokens (Zeyliger, <a href="https://blog.exe.dev/expensively-quadratic" target="_blank" rel="noopener">Expensively Quadratic</a>, exe.dev, 2026).</li>
<li>Agents typically use about 4x more tokens than a chat, and multi-agent systems about 15x more; token usage alone explained 80% of the performance variance on Anthropic's research eval (Anthropic, <a href="https://www.anthropic.com/engineering/multi-agent-research-system" target="_blank" rel="noopener">How we built our multi-agent research system</a>, 2025).</li>
<li>"The gap between prototype and production is often wider than anticipated," because errors compound across long, stateful runs (Anthropic, <a href="https://www.anthropic.com/engineering/multi-agent-research-system" target="_blank" rel="noopener">same source</a>, 2025).</li>
<li>Production bills are landing hard: Uber blew through its entire 2026 AI coding budget by April, and one analysis found heavy users spent about 10x the tokens of lighter users for roughly 2x the output (reported, Bellan, <a href="https://techcrunch.com/2026/06/05/the-token-bill-comes-due-inside-the-industry-scramble-to-manage-ais-runaway-costs/" target="_blank" rel="noopener">TechCrunch</a>, 2026).</li>
</ul>
<h2>Why does cost grow faster than the number of steps?</h2>
<p>The agent has no working memory of its own. On every turn it re-sends the whole conversation so far: the system prompt, tool definitions, every prior thought and tool result, then adds the new step on top. Step 20 does not pay for one step of work. It pays to re-read everything from steps 1 through 19 again. Billed input grows roughly as tokens times number of calls, not linearly. An exe.dev analysis of a real coding session put it plainly: re-read history crossed half the bill at 27,500 tokens and hit 87% of the total cost by the end. Price per token never changed. The amount of context being re-sent did.</p>
<h2>Why was the pilot so cheap then?</h2>
<p>The pilot was short. Short is where this math is forgiving. A demo runs the happy path: clean question, three or four turns, tidy answer, done before the re-sent context ever stacks up. That is a real measurement. Of a small slice of the curve. Production runs the part the demo never touched. Anthropic measured agents using about 4x the tokens of a chat, and multi-agent setups about 15x. Token usage alone explained 80% of performance variance on their research eval. Capability and cost ride the same axis. The pilot bought you a glimpse of the bottom of the curve, then production handed you the rest of it.</p>
<div class="fig"><img src="/blog/article9-diagram.png" alt="A chart where step count rises in a straight line while cumulative tokens billed curves upward, with retries and tool fan-out marked as multipliers"/></div>
<h2>What actually pushes the bill up in production?</h2>
<p>Length, multiplied by everything that adds length. Failed steps do not just cost their own tokens. They re-send all prior context to try again, so one stuck spot can re-bill the whole history several times. Parallel tool calls and subagents each carry their own context, which is how multi-agent systems reach 15x a chat. Production tasks simply run for more turns than a demo, and every extra turn re-reads the transcript. Per-token prices have even fallen. The bill rises because autonomous agents on real tasks generate far more turns, and each turn pays to re-read the ones before it.</p>
<h2>Which levers actually cut the cost?</h2>
<table style="width:100%;border-collapse:collapse;margin:1.5rem 0;font-size:0.97rem;"><tr><th style="text-align:left;padding:10px 12px;border-bottom:2px solid #e5e7eb;color:#5E6AD2;font-weight:600;">Lever</th><th style="text-align:left;padding:10px 12px;border-bottom:2px solid #e5e7eb;color:#5E6AD2;font-weight:600;">What it cuts</th><th style="text-align:left;padding:10px 12px;border-bottom:2px solid #e5e7eb;color:#5E6AD2;font-weight:600;">How</th></tr>
<tr><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Scope the context</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">The re-sent payload</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Send each step only what it needs, not the whole transcript</td></tr>
<tr><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Reset the conversation</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">The compounding history</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Start fresh for a new sub-task; re-establishing context is usually cheaper than carrying it</td></tr>
<tr><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Cap retries and steps</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Runaway re-billing</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Hard limits so one stuck step cannot re-send history endlessly</td></tr>
<tr><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Route by task</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Per-token price</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Send easy steps to a smaller model; reserve the frontier model for hard ones</td></tr>
<tr><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Offload to tools</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Main-context tokens</td><td style="padding:10px 12px;border-bottom:1px solid #eee;vertical-align:top;">Do iteration in a tool or subagent so it never enters the main window</td></tr>
</table><p><!-- conviction-start -->Context re-sends each turn, tokens outrun steps; the upgrade moved the benchmark, not the bill.<!-- conviction-end --> (<a href="https://blog.exe.dev/expensively-quadratic" target="_blank" rel="noopener">Expensively Quadratic</a>)</p>
<p>None of these is "buy a cheaper model." The cost was never really about price per token. It was about how much context each step has to carry and how many steps a task actually runs. Which steps stay short and cheap, and which balloon into long, retry-heavy, fan-out-heavy paths that drive the bill, is what VibeModel maps as the Pattern Intelligence Layer.</p>
<h2>Frequently asked questions</h2>
Why does my agent cost so much more in production than in the demo?
Because production tasks are longer. The demo ran a short happy path; production runs long real paths with retries and tool fan-out. Each turn re-sends the whole prior context, so cost compounds with length. Same price per token, far more tokens.
Will switching to a cheaper model fix it?
Only partly. Routing easy steps to a smaller model lowers price per token, but the main driver is how much context each step re-sends and how many steps run. Cut the context and the step count first; route second.
Why does cost grow faster than the number of steps?
Because every step re-sends all prior context, so billed tokens grow roughly as tokens times calls, not linearly. In one real session, re-read history was 87% of the cost by the end and crossed half the bill at 27,500 tokens.
Is starting a new conversation wasteful?
Usually the opposite. Re-establishing context in a fresh conversation is typically cheaper than carrying a long history that gets re-sent on every turn, and the result is often the same. Reset between sub-tasks.

