Sub-Agents in Claude Code: Keeping Claude Focused
Sub-agents keep a Claude Code session's context window clear by pushing scoped work onto cheaper model tiers, then run up to twenty of them in parallel.
The scarce resource in a Claude Code session isn’t money. It’s the main thread’s focus, and everything already loaded into its context window is spending it.
I’ve already run into what happens when that window fills with the wrong things. A bloated CLAUDE.md quietly wrecked a session I was running before I’d typed a single instruction, because Claude Code loads it whole, every time, whether the current task needs it or not. Sub-agents create the same problem after the session is already running. My main thread runs on Fable, Anthropic’s most capable model, because that’s the seat that plans and decides and accepts or rejects. Read a sub-agent’s raw output back into that thread in full and every token of it competes for Fable’s attention with every token already sitting there, the same as a stale instruction would. Delegation exists to keep that from happening: hand the work to a session with its own window, and only the conclusion comes back.
The System
A sub-agent is a second Claude Code session, spawned from the one you’re driving, that takes a scoped task, does its own reading and writing inside its own context window, and reports back. It can run on a cheaper model than your main session runs on. That’s the whole mechanism, and it’s the part that matters here. Sub-agents put a cheaper model in the seat when the seat doesn’t need your most expensive one.
My setup treats that choice as a ladder, not a toggle. Four tiers, and the multiplier between them matches Anthropic’s own published per-token API pricing exactly, the same ratio on input and output alike. It’s relative cost, not what I pay on a Claude Code subscription, and it’s the ladder my own delegation plugin routes against:
| Tier | Model | Cost | Who lives there |
|---|---|---|---|
| Architect | Fable 5 | 10x | Main thread. Plans, decides, accepts or rejects. Never greps. |
| Orchestrate | Opus 5 | 5x | lead owns a work item, research owns a question, reviewer audits finished work. None of them edit. |
| Do | Sonnet 5 | 3x | worker writes code, writer writes prose, explorer searches. |
| Mechanical | Haiku 4.5 | 1x | mechanic runs narrow greps and mechanical edits. |
Seven named roles sit across the three delegated tiers, each pinned to the model that matches what the role needs to be good at. worker doesn’t need Fable’s judgment to implement a change I’ve already scoped. mechanic doesn’t need Sonnet’s reasoning to find every call site of a function.
One placement is worth noticing. reviewer sits at Opus, one tier down from the architect, not at the bottom with the other doers. That’s the instinct to use the more advanced model for validation, and it’s already built into the roster. The agent checking finished work gets the second most expensive model in the stack, because catching a mistake takes closer to architect-level judgment than making the first pass does.
What Delegation Buys
Anthropic’s own research on multi-agent systems found agents run roughly 4x the tokens of a single chat turn, and multi-agent setups run closer to 15x. Sub-agents do not shrink the bill by default. Spawning four workers to parallelize a task can cost more in aggregate than doing the same work in one session, serially.
What the ladder controls is which tier pays for which kind of work, not whether the total goes up or down. At Fable, a grep I run myself is the most expensive line in the session. At Sonnet, it’s a rounding error. Skipping the orchestrator doesn’t dodge that cost, because the work just moves into the architect’s context at the architect’s rate, filling the exact space delegation was meant to protect.
None of lead, research, or reviewer exist to save money either. lead buys an owner and context isolation for a job that touches several files. For a question that needs more than one angle, research buys the same isolation. reviewer buys independence, a second set of eyes that doesn’t share the blind spots of whoever wrote the thing. It’s runway: my own context stays free of the transcripts those roles generate, so there’s still room left for the decisions I actually need to make.
Twenty sub-agents can run at once in a session by default, and what to do with that much concurrency is its own argument. The one this post makes is narrower: protecting the window pays off the moment I delegate a single task, before parallelism ever enters the picture.
Try It Yourself
The honest complication is that none of this pays off by reflex. Whether the total bill actually drops depends on how wide you fan out, and spawning an agent to avoid a two-file edit buys nothing while still costing a cold context. When the work is small, or the next step shares most of its context with what I’m already doing, or the round trip costs more than the work itself, it stays in the main thread.
Here’s a prompt that sorts a task list onto the ladder for you, tier by tier, and says what each item would have cost to do yourself instead.
Delegation keeps my main thread focused on the decisions that actually need Fable, instead of filled with the legwork that doesn’t.