Subagents make Claude Code cheaper
Subagents in Claude Code are usually described as a way to split up work or keep the main conversation tidy. They do that, but in my experience the bigger win is cost. A subagent starts with an empty context, does its task, and hands back a short summary. If the main session did that work itself, it would pay to re-read its existing context on every step of the task, and then carry everything the task produced through the rest of the session.
This applies to subscriptions too. Plan limits are measured in tokens, so your session and weekly usage go up in step with the dollar cost, and subagent requests count toward the same limits as the main conversation.1 Anything that saves money also makes your limits last longer.
What a turn actually costs
Here are the list prices for Claude Opus 5.5:2
| Token type | Price per million tokens |
|---|---|
| Input | $4.00 |
| Cache write (5-minute cache) | $5.00 |
| Cache write (1-hour cache) | $8.00 |
| Cache read | $0.20 |
| Output | $20.00 |
Input and output are the prices everyone quotes, but they have little to do with the bill. Claude Code sends the whole conversation with every request: every time Claude replies or calls a tool, the system prompt, all previous messages, every file it has read and every command output go to the model again.3 Almost all of that is read from the prompt cache, and only what’s new since the last request gets written to it.
Take one tool call in a 400k-token session that adds 3k tokens of output to the context, with a short 500-token reply:
| Tokens | Cost | |
|---|---|---|
| Cache read: the existing context | 400k | $0.080 |
| Cache write: the new tool output | 3k | $0.015 |
| Output | 500 | $0.010 |
The cache read is the cheapest token type by far, and it’s still three quarters of the cost, because the whole context is read again on every turn. A task is dozens of these turns. In the example later in this post, cache reads are 77% of the total.
Cost grows with the square of the context
Since every turn pays for the whole context, and each turn makes the context a bit bigger, the cost of a session doesn’t grow in a straight line. If every turn adds about the same amount, turn n reads n times that amount, and the total is about n²/2. Twice as long a session costs about four times as much.
My own sessions follow this closely. Each blue point below is a snapshot of one session: its total cost so far against the size of its context at that moment. There are 13,718 snapshots from 101 sessions.

A power-law fit gives an exponent of 1.9, so close to quadratic. A session at 200k tokens has cost about $10, one at 400k about $36, and one at 800k about $135.
The orange points are snapshots where more than half of the context was written to the cache again: the cache had expired, or something like a model switch reset it. You can see them as small jumps. A cache write costs 25 times as much as a cache read on Opus 5.5, so letting the cache of a large session expire is one of the easiest ways to spend much more than you need to. At 400k tokens, the turn after an expired cache costs $2.00 instead of $0.08. I keep a countdown in my status line for exactly this reason.
Two ways to keep sessions on the cheap end of that curve are to /clear often, and to keep work that
produces lots of tokens out of the main context in the first place. That’s what subagents are for.
How subagents help
When Claude hands a task to a subagent, the subagent starts a new conversation. It gets its own system prompt and tools, plus a task description Claude writes for it, but none of your conversation history.4 It does the work, sends back a summary, and its context is thrown away. All the file reads, searches and command output stay in the subagent.
That saves in two places:
- During the task. Each of the subagent’s turns re-reads only its own small context, not your session’s existing one.
- After the task. The main session gains a short summary instead of everything the task produced, so every later turn is cheaper too.
A worked example
Say the main session is at 200k tokens, and you have three tasks to do. Each one takes 50 turns and adds 150k tokens of context. Either the main session does all three itself, or it hands each one to a subagent. A subagent starts with about 12k tokens of system prompt, tools and instructions. The main session keeps about 1.5k tokens per task: what it asked for and the summary it got back.
- Cache read
- Cache write
- Output
Show numbers
| Cache read | Cache write | Output | Total | |
|---|---|---|---|---|
| One session | $12.84 | $2.25 | $1.51 | $16.60 |
| Subagents | $2.72 | $2.45 | $1.54 | $6.71 |
With subagents, the same work costs 60% less: $6.71 instead of $16.60. Cache writes and output are about the same either way, since the same work gets done. The whole difference is in cache reads.
The next chart shows why. Each panel shows the tokens sent with every request, so the shaded area is everything sent, and almost all of it is read from the cache:
- Main session
- Subagent
One session does all the work
Subagents do the work
Show numbers
| Requests | Tokens sent in total | Largest request | |
|---|---|---|---|
| One session does all the work | 151 | 64.6M | 650k |
| Subagents do the work | 154 | 14.1M | 205k |
The single session starts every turn of task A at over 200k tokens and is past 600k by the end of task C. In total it reads 64.2M tokens from the cache. The subagents each start from almost nothing, and the main session waits in between, sending nothing. Together they read 13.6M.
The saving doesn’t stop when the tasks are done. Here’s what’s left in the main session’s context afterwards:
- Context before the tasks
- Added by the tasks
Show numbers
| Context before the tasks | Added by the tasks | Total | |
|---|---|---|---|
| One session | 200k | 450k | 650k |
| Subagents | 200k | 4.5k | 205k |
With subagents, the main session ends at 205k tokens instead of 650k. Every turn after this reads 446k fewer tokens, which is $0.09 less per turn on Opus 5.5, for the rest of the session.
When subagents don’t help
- Small tasks. If a task is only a few tool calls, or the main session is still small, the two approaches cost about the same. The subagent then mainly keeps your context tidy.
- The main session’s cache expiring. While a subagent works, the main session sends nothing, so its cache can expire. On a subscription the main conversation’s cache lasts an hour, so this rarely matters. With an API key it lasts five minutes, so a subagent that runs longer than that means the main session writes its whole context again when the result comes back. At 200k tokens that’s about $1.00. Even if it happens after every task in the example, the subagents still save 42%.
- Forks. A forked subagent copies the whole conversation instead of starting fresh.5 Its first request can reuse the main session’s cache, but every one of its turns re-reads your full context, so you lose most of the saving.
- Long reports. The summary a subagent sends back stays in your context. Many subagents that each send back pages of detail can add up to as much as doing the work yourself.
Getting Claude to use them
Claude Code delegates on its own, especially for exploring a codebase, where it uses the built-in Explore subagent. You can push it further by asking for it: “use a subagent to run the tests and tell me what failed”, “have a subagent read the docs for this library and summarize the API”. Good candidates are tasks that read a lot and report back a little: running test suites, reading logs, searching a codebase, fetching documentation, reviewing a diff.
Subagents can also run on a cheaper model. A subagent definition in .claude/agents/ with
model: haiku runs on Haiku. If you name it Explore, it replaces the built-in Explore subagent, so all
exploration runs on the cheaper model.
References
Footnotes
-
Claude Code docs, Create custom subagents: “Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. It also sends its own requests, which count toward the same usage limits as your main conversation.” ↩
-
Claude Code docs, How Claude Code uses prompt caching: “The model doesn’t remember anything between requests, so Claude Code re-sends the full context: the system prompt, your project context, every prior message and tool result, and your new message.” ↩
-
Claude Code docs, Create custom subagents: “Each subagent starts with a fresh, isolated context window. It doesn’t see your conversation history, the skills you’ve already invoked, or the files Claude has already read.” ↩
-
Claude Code docs, Create custom subagents: “A fork is a subagent that inherits the entire conversation so far instead of starting fresh.” ↩