Skip to content

Who's Eating Your Agent Budget? Subagents, Mostly

#claude-code #coding-agents #ai-cost-optimization #multi-agent-systems #model-routing

The Wednesday Problem ​

My Claude Code week started ending on Wednesday. I blamed the September 14 cut, like everyone on r/ClaudeAI did. Then I opened the usage screen and the biggest line was not me typing. It was the helpers I had told it to launch.

So I read a month of my own logs before touching a single setting. 455 sessions, 2,631 subagent runs, 63,000 requests. I wanted to know which of the five fixes everyone lists actually gives a measurable share of the week back, and which one just costs quality. The audit reshaped how I run every agent session, and almost none of it matched the conventional advice.

Subagents Are the Silent Billing Line ​

Claude Code writes one JSONL file per session under ~/.claude/projects/, and one file per subagent run next to it. Every assistant line carries the usage of its request: input, output, cache reads, cache writes. The first trap is double counting. The log writes the same answer about twice per request (1.96 lines per request in my month), so summing every line gave 18.6 billion tokens. De-duplicated on message id and request id, it was 9.3 billion. Every number below is the de-duplicated one.

The numbers that mattered:

What I countedValue
Sessions in the month455
Subagent runs2,631
Raw JSONL sum18.6B tokens
De-duplicated total9.3B tokens
Share going to subagents48.1% of tokens, 64% of output
Median subagent launch cost47,117 tokens per spawn

The 47,117-token launch cost is the number that changed how I think. Before a subagent does anything, its opening request already carries the instructions, the tool list, the skill list, all sent again. That is roughly the size of a small module, paid on every spawn. One developer measured 16 to 21k on a different machine with tiny agent prompts, and their line stuck with me: your agent file is a rounding error inside its own launch cost.

Model inheritance is the other half. A subagent inherits the main session's model unless the agent file says otherwise. Switch to the biggest model for yourself and every helper runs on it. In my logs the smallest model handled under 1% of subagent requests. Pinning haiku on test-runner agents is the cheapest fix I found, with one caveat: a small model that needs more turns can cost more than a big one that finishes in one. Nobody has measured that tradeoff as a share of the week, so it stays a habit with a direction, not a percentage.

The September cut is simple arithmetic. Call the old weekly limit 100. The summer promotion made it 150. The permanent level since September 14 is 125. From 150 to 125 is the 17% people feel, and Anthropic's "+25%" is true at the same time. The cut hurt, but the subagents were leaking far more. Also note the limits are published as percentages and plan multipliers, never token counts, so your split may differ. The usage screen will tell you.

The popular tips weighed less than advertised. Removing MCP servers is the fix everybody repeats, but tool definitions are deferred by default now; one article counted 1,350 tokens for 51 tools across three servers, while a single server with one tool cost 18. Prompt suggestions measured 3 to 4% on one account and up to 10% on another with enormous contexts. Filtering shell output: about a tenth of one percent. All three grow with your context size. Switch them off if you like. Don't expect the week back.

The Five-Minute Cache Nobody Lists ​

The main session's prompt cache lives one hour on a subscription. A subagent's lives five minutes. My logs agree with the docs on this: every cache write from a subagent landed on the 5-minute tier, every write from a main session on the 1-hour tier.

One setting moves it:

json
{ "subagentPromptCacheTtl": "1h" }

A developer whose subagents wait on long builds saw cache writes drop from 12 million tokens to 3 million after the change. In my own logs it barely matters: 2 requests in 1,000 arrived after a wait of five minutes, though each one rewrote about 75,000 tokens. If your subagents idle, turn it on. If they run in short bursts, leave it, because an hour of cache costs more to write.

The lunch break number is the one I did not expect. A message sent within five minutes of the previous one wrote about 1,200 tokens of cache. After a pause of more than an hour, the median was 130,332. The session at that moment held about 175,000 tokens, so most of it was written again. Cache writes are priced above plain input: 1.25x base on the 5-minute tier, 2x on the 1-hour tier. A cold return of 130k tokens costs more than sending those tokens with no cache at all.

Gap before the messageSessionsCache written (median)
under 5 minutes18,0291,176
5 to 60 minutes4141,327
over 60 minutes79130,332

Two cheap habits. Clear the session when a task is done, while the cache is still warm, so the next task starts small. When Claude Code offers to resume a big session from a summary after a break, take it. A model switch mid-session empties the cache too, since each model keeps its own. Caveat from my logs: 79 cold returns is a small sample, and some follow a compaction rather than pure idle. The direction is clear, and it costs nothing to act on.

Quick Take: Subagents are the biggest line on your agent bill, but the fix is boring: fewer spawns, smaller models on the ones you keep, longer cache TTL.

The Upside: Teams Find More Bugs ​

Cost is only half the story. Multi-agent setups find bugs single agents miss. Anthropic released a test in October: 116,000 lines of code with 70 planted bugs, run three times with a single agent and three times with a dynamic multi-agent workflow. Best single-agent run found 27 bugs, under 40%. The dynamic workflow found 66 of 70 on all three runs.

This is the new Claude Managed Agents public beta. Give the main agent a task and it writes its own workflow program: which agents read the material, which stage processes results, which branch to take next, where to loop. The contract review example shows the shape. Checking 300 contracts for a change-of-control clause becomes a written program, not a conversation:

The key difference from ordinary subagent delegation: the main agent is not in the loop. Intermediate handoffs are baked into the program, so the main agent can keep talking to you while the workflow grinds in the background. The official prompt example requires that a contract an agent cannot read gets flagged as "uncovered" instead of silently skipped. "Didn't find a bug" and "never looked at the file" stay separate.

Before you get excited: Anthropic did not disclose the model, the agent count, the runtime, the token usage, or the false-positive rate. More bugs were found. Whether it was worth it is unknown. Managed Agents bills per token plus $0.08 per session-hour while the session runs, and a session budget pauses the workflow when hit, though already-sent model requests still complete and can exceed it. The 1,000-agent ceiling sounds dramatic; the 64 concurrent threads is the number that shapes real costs. And there is a structural catch: once a workflow thread hands results back, the main agent cannot query that thread further. Verification and rework have to be designed into the program up front.

Effort level is the closest comparable knob I have data on. One developer ran 29 real tasks at all five effort levels. Mean cost per task went from $2.50 at low to $8.84 at max. Medium passed 28 of 29, more than any level above it. His words: the curve appears to peak at medium. Then the catch. On the hard problems he picked, low passed 0 of 5 and high passed 5 of 5. A low attempt took two minutes, a high one thirty-three. Medium to build, high when a mistake is expensive, max almost never.

What Forking Changes ​

All of this economics assumes you can get back to a good state. You usually cannot. Once an agent has spent an hour exploring, failing, and rewriting files, that state is worth more than any single output, and re-running the prompt does not reproduce it. I ran the identical prompt twice on the same model. The first build took 91.6 seconds and 26,656 input tokens. The second took 31.3 seconds and 2,558. Same words, different app: light instead of dark, different numbers throughout, batch #1047 instead of BR-1042. The setup cost varied by a factor of three.

I tested DigitalOcean's Managed Agents, which runs each session in its own microVM and lets you checkpoint, fork, and roll back the whole machine. A checkpoint took 25.2 seconds. Forking three ways took 15.3. Every fork woke up with its web server already running: same PID 593, serving the same file. A fork here is not a copy of a disk you then boot. It is a copy of a running machine, including live processes, and each copy carries on from the instant the checkpoint was taken. Each fork then got a different design brief, and three different apps grew out of one running machine.

Rollback is the half that feels like cheating. I killed the server and deleted the app directory. Rollback took 5.6 seconds. The file came back, and so did PID 593, the process I had explicitly killed, restored from memory rather than restarted. Put a checkpoint in front of anything risky and a bad step costs six seconds instead of the whole session.

The community experiments added two caveats I did not test. If a fork copies memory, it copies the state of every random number generator in it: three forks may mint identical UUIDs, session tokens, and idempotency keys from the checkpoint onward until the guest kernel reseeds. And rollback rewinds the machine, not the world: any API call, push, or message the agent sent after the checkpoint stays sent. A checkpoint protects the box, not what the box already told the internet. Treat anything minted after a fork as possibly duplicated until someone runs the entropy check. The same logic applies to credentials: a live process holds whatever tokens are in memory, and every fork gets a copy.

The Model-Routing Shift ​

The biggest structural change this month is agents picking their own models, and the picks are not flattering to the model owners. Google Cloud's new Gemini Agent can hand off hard tasks to Claude. Musk announced Grok Bot will route by task, and Claude is on that list too. Google, which trains its own flagships, ships a product that calls a competitor's model when the task calls for it.

The benchmark gap explains why. On Google's own tables, Gemini 4 Argon scored 57.4% on Terminal-Bench 4.0 against Claude Opus 5.5's 66.4%, and 55.0% on FrontierSWE v2 against 62.3%. Independent leaderboards agree: Vals AI has Opus 5.5 at 65.15% and Argon at 57.58%. Nine points on agentic terminal tasks is not a rounding error. It is the difference between a tool that reliably edits, runs, and retries, and one that stalls on a surprising intermediate result.

BenchmarkClaude Opus 5.5Gemini 4 Argon
Terminal-Bench 4.066.4%57.4%
FrontierSWE v262.3%55.0%

The enterprise numbers make the case in dollars. Asana used GPT-6.1 Sol in Codex to make its browser agent 76x cheaper and 5x faster in tests. A suite that took one unit of budget now takes one seventy-sixth, which turns a nightly browser-test run from a budget line into a rounding error. LegalOn cut estimated daily Codex spending by 65% while keeping development speed, by matching Astra, Sol, and Luna to task types instead of defaulting everything to one model. Oracle reports turning days of work into minutes across recruiting, engineering, and operations. Same pattern everywhere: the agent is the product, the model is the part you swap.

Anthropic is consolidating its position underneath all of this. Claude Code became the reference implementation: the Agent SDK, the Mods plugin system, startup credits, and a monthly API allowance for Max and Team subscribers all push developers to build on Claude's tooling. Google and Musk both choosing Claude for hard tasks is the strongest signal yet that in the agent era, who makes the best model and who makes the best agent are becoming two different businesses.

The Capability Frontier ​

The same week my budget math was happening, the other side of the ledger was showing what agent spend buys. Claude Opus 5.5 decompiled a PS2-era game overnight, and hundreds of those ports now run in browser tabs. A multi-hundred-thousand-line codebase reconstructed from assembly into something playable, in one night.

REA (Reverse Engineer Anything) took the same idea to binaries. It is an MCP broker between an agent and Ghidra or Hopper: point it at a commercial app, ask how the clipboard bridge works, and it decompiles, reads the assembly, traces the interfaces, and hands back a working C++ reimplementation. It pulled roughly 70,000 GitHub stars in its first two days, approaching 80,000 by the third, a steeper curve than OpenClaw's 60,000 at the same point. The author is already poking at Office-scale targets.

But the ArtCraft story is the cautionary tale. One experienced developer rebuilt seven Adobe applications in Rust with Claude Opus 5.5, free and open source. Users confirmed the basics: layers, masks, brushes, PSD open and save. Then the edge cases arrived. A PSD with smart objects opened wrong. A professional file was slow and error-prone. Of 30 filter test cases, only 5 matched Photoshop's output. The "month to full parity" timeline slid to "months, maybe." AI coding compresses the first 80% of a product into days. The last 20% is exceptions shaped by years of real files and user feedback, and that part does not yield to more tokens.

The same week's trending lists read like a census of the boom: a job-search framework built on Claude Code that produced 69 tailored applications, 20 first interviews, and one signed contract; a PowerPoint generator that writes natively editable PPTX; a self-hosted repository index that cut an agent's tool calls per question from 7.2 to 3.8 on django/django. As one of those READMEs puts it, the harness plus the model is the agent. Everyone is building the same thing.

Common Pitfalls ​

Five mistakes show up repeatedly in my logs and in the community threads.

Summing the raw JSONL without de-duplicating. The log writes the same answer about twice per request. My raw sum was 18.6 billion tokens; the de-duplicated total was 9.3 billion. A quick script that sums lines gives you double the real number, and the inflated number is