In June I ran Claude Code the way the tool invites you to. One session, open all day, the best model available, keep going until the work was done. By August the same repository logged 389 sessions, and 94.6% of its agent calls went to Haiku and Sonnet specialists with hard return budgets, and a hook was ending sessions at a token line I had set in advance.
The guidance that got me there is published. Isolate exploration in subagents. Keep the main context small. Restart instead of stretching a session. Put persistent rules in files and hooks. I ran them for three months on one repository and measured every session and every subagent transcript against them, with a script that reads the transcript files Claude Code already keeps on the machine.
The question I wanted answered was where the cost of an agent sits once the fan-out is already cheap.
My first pass summed every assistant line in the transcript files and produced a table I nearly published. Claude Code writes one assistant message as several lines, one per content block, and every line repeats the same cumulative usage block. In August, 53% of main-session lines and 56% of subagent lines shared a message id and request id with another line. Every sum in that table was inflated by 50 to 70%.
The peak-context rows and the call counts were untouched, which is the tell: sums double-count, maxima cannot. The fix is four lines. Deduplicate on that key and keep the last record, since output tokens grow across blocks. ccusage keys on the same pair, independent confirmation that the measurement was fixed.
Everything below comes from the corrected scan, frozen on the second of September with August closed.
An audit I ran at the start of July found my sessions at 660k to 999k tokens of context. The statusline that should have warned me only renders in the terminal CLI. The VS Code extension, where I did most of that work, never shows it. I had a threshold and nowhere for it to appear.
The fix was to take the warning off the screen and put it in the harness. A hook reads the tail of the transcript on every prompt and injects the warning as context the model itself sees, at 100k and 150k absolute tokens rather than a percentage of the window, because a million-token window earns no extra headroom. A rule a human reads is advice. A rule a hook injects is enforced.
The rule that did the most work has nothing to do with context pressure. Finish the task, write the handoff while the session is still sharp, start fresh. A handoff written at a fifth of the window comes from a sharp session; one written at two thirds comes from the most degraded version of it. Tokens billed to the frontier model in the main conversation, input plus output plus cache writes after deduplication, fell from 850,251 per session in June to 185,156 in August, and the share of sessions whose peak context crossed 150k fell from 55% to 33%.
Peaks caught what sums could not. One August session reached 571k tokens because a single pasted image was re-sent on every turn after it. The sum metrics never flagged it. The peak-context column did, the same day.
Delegation only paid after the return format became a contract the subagent reads at point of use. Before that my specialists explored cheaply and then returned the transcript of their exploration, which landed in the orchestrator's context as paste. The saving re-entered as a cost one turn later. Delegation does not save context if the delegate returns its working set.
Each of the five specialists I run now carries a line cap, 15 to 20 lines, and an overflow rule: never paste file bodies; if a file matters, say why and where, and the caller opens it. The contract lives in the agent definition, so it is read at the moment the agent answers. A contract in my head is a suggestion.
The failure on the other side is a stalled delegate. One stuck measurement agent pulled roughly forty retrieval calls back into the frontier-priced main thread and pushed that session past 150k in one task. The rule that came out of it: re-spawn once with a tighter prompt before any retrieval falls inline.
Here is the number that cut against the story. 83.5% of August sessions still crossed 100k tokens of context, up from 70.7% in June, in the same month the 150k share fell by a third. Sessions got shorter and more numerous by design, and the ones that stayed long were long on purpose.
The token split explains it. In August the subagents did 56.4% of all input, output and cache-write tokens, up from 16.5%, while the main conversation held 82.2% of the price at list rates. Both numbers are true at once. Token share and price share had separated, and the second explains the first. Cheap models absorbed the token majority at Haiku and Sonnet prices, which is exactly what leaves the frontier-priced main thread carrying the spend.
The Anthropic guidance I found describes the window saving from delegation. I did not find the next question addressed: once the fan-out is cheap, where does the remaining cost concentrate? For one operator's workflow it sits in the main conversation: tool results, re-reads of files already in the window, and long autonomous turns pulling their own output back into context. The month I audited re-reads, one file was opened about twice a session because opening it felt like diligence. That habit alone was about a million and a half tokens.
In September Anthropic published commerce-agents, a reference blueprint for shopping and merchant agents. Its config carries a maximum of eight tool iterations, and the last iteration sets tool choice to none so the model has to answer in text. History compacts above 100,000 tokens. A clamp helper caps any count the model supplies at a ceiling. The memory tool caps a stored fact at 64 characters of key and 200 of value, in the tool schema and again at runtime.
Those are context budgets enforced in code, with defaults someone had to choose, in a blueprint meant to be copied. I spent three months arriving at the same axis from the outside by measuring my own transcripts. The numbers above are what the budget looks like when nobody has set one for you.
What this does not show
Three changes landed together in the window, the restart rule, the return contracts and the context hook, so the two columns are a shift in shape rather than a controlled experiment. Per session is a poor unit when sessions shrink by design; the threshold rows are per session by construction and are the cleaner signal.
The dollar figures are a list-price proxy for one developer on a subscription, so the ratios hold and the totals do not. Quote the token figures. Peak context is a definition choice, input plus cache writes plus cache reads; drop the cache reads and the threshold shares move by about a point.
When the records repeat, trust the peak before the sum.
Measure peaks rather than sums, and deduplicate before you believe either. Give every delegate a return budget it reads at the moment it answers. Put your thresholds in a hook rather than on a statusline. And treat any workflow you have not measured as pending.
The script is MIT, standard library only, and reads the transcripts already on your machine: github.com/jfkconstruct/contextbudget. The full report, with the assumptions and the parts that did not hold, is in the repo.