
Token-draining agent sprawl in Claude Code has a measurable cost: an Anthropic customer’s single-agent setup ran about twice as fast. The AI coding assistant can reread files as separate agents start fresh, using up your allowance before a job finishes. You can reduce that repeated work, but merging agents can also break steps that previously succeeded. Find out how to spot unnecessary handoffs and test a leaner setup without losing useful checks, as AI Labs walks through when separate agents earn their place.
Claude Code: Cutting the Cost of Agent Sprawl
TL;DR Key Takeaways :
- One Anthropic customer found a single-agent setup ran about twice as fast as a setup with many agents.
- Anthropic identifies three reasons to use subagents: relieve an overloaded session, run independent jobs in parallel, or separate conflicting tools and instructions.
- Anthropic recommends assigning agents separate app areas rather than task types to reduce overlapping work and overwritten changes.
- AI Labs recommends a fork when a job needs the main session’s context, avoiding the cost of reading files again.
- Anthropic advises testing the same 10 tasks before and after workflow changes to identify results that went from working to broken.
Anthropic’s Claude Code is an AI coding tool that can read a codebase, edit files and run commands. Its main session can delegate work to subagents, each with its own context that counts separately toward usage.
On subscription plans, Claude Code shares an allowance with other Claude activity, and usage depends on the model and the length and complexity of your interactions. Claude Code is included with the Pro plan, which costs $20 per month with monthly billing.
Keep Dependent Steps in the Main Session
A subagent starts with a short prompt rather than the main session’s conversation or the files it has already read. It must load the instructions and files it needs again, so repeated reading adds to usage. A workflow with too many agents can exhaust its limit before the job is finished.
Subagents return summaries rather than their complete working context. That can be enough when the main session only needs an answer, but it loses detail when a later step needs the work behind that answer.
Anthropic recommends letting one main session plan and carry out work when each step depends on the previous one. It can write a plan at the start and update it as results come in, instead of passing the plan through separate planning, building and testing agents.
One Anthropic customer found that a single-agent setup ran about twice as fast as a setup with many agents; an Anthropic team saw the same pattern across a number of companies. Anthropic calls the buildup of agents doing nearly the same work agent sprawl. When their descriptions overlap, Claude can also select the wrong agent for a job.
Here are additional guides from our expansive article library that you may find useful on Claude Code agents and workflows.
- When to Choose Claude Code Single Agents, Sub-Agents, or Agent Teams
- Claude Code Agent Teams : Enable Multi-Agent Projects for Faster Shipping
- Claude Code Sub-Agents : The Secret to Smarter Coding Workflows
- Claude Code Sub Agents : Build AI Automation Agents in Minutes Without Coding
- Using Claude Code Subagents to Turn Images into a Working Build Guides
Delegate Jobs That Need a Fresh Context
A subagent can be useful when its separate context serves a purpose. Anthropic identifies three cases where starting one can be worth the cost: relieving an overloaded main session, running independent jobs in parallel, or separating conflicting tools and instructions.
If the main session starts performing worse because it is carrying too much context, it can delegate work whose intermediate details it will not need again. Starting a completely new session instead would lose the existing plan and decisions. For example, a subagent could write tests for a feature before the main session builds it.
Parallel jobs can each use a clean context and return a summary when finished. Separate pages of an app, for instance, can be assigned to different agents if neither page depends on the other’s work. Splitting work can also help when an agent repeatedly chooses the wrong tools or receives conflicting instructions, because each agent can get a smaller set that fits its job.
AI Labs advises against creating a design or styling agent merely because the task feels distinct. If the work does not need one of those three forms of separation, it can stay in the main session.
Split Work by App Area, Not Task Type
Anthropic recommends dividing an app by context, giving each agent its own part. Assigning agents by task type can put two of them on the same part of the app, where they may overwrite changes and pass work back and forth.
A short return summary works when no later task depends on how the agent completed its work. The same approach can suit research where the main session only needs the answer, or a review of finished work that returns a report.
For an existing setup, Anthropic recommends merging agents that work on the same data, nearly always run together, or must wait for each other’s output. Start with the most frequently used pairs: each avoided handoff removes another fresh start and another summary from the chain.
A separate reviewer can be an exception even when it runs immediately after the builder: the reviewer can inspect the result without the builder’s reasoning in its context. Anthropic also lists reviewing as a suitable subagent job and suggests starting with a simple setup, such as one agent that builds and another that checks.
Use Skills and Limit What Agents Load
Repeated instructions can go in a skill rather than a new agent. For code review, you can put your review instructions in a skill and give it to a reviewer; the main session can load the same skill while building, so you only need to write the instructions once.
Only a skill’s short description loads until it is needed, after which the full skill loads. A subagent given one skill can still load more than that skill, so AI Labs recommends asking Claude Code both to give the reviewer its skill and to prevent it from loading others.
You can also ask Claude Code to omit project rules from an agent that does not need them, or to use a cheaper, faster model for a simple job. Claude Code can configure subagents on request without requiring you to edit their files yourself.
When a job needs what the main session already knows, AI Labs recommends a fork instead of a fresh agent. A fork copies the conversation and reuses what the main session has read, avoiding the cost of reading it all again.
Trim Instructions That Load Repeatedly
Agents load CLAUDE.md when they start, so a long file adds a recurring cost. Rules added for older models can also slow an agent down, while a growing file can accumulate conflicting instructions.
Anthropic recommends removing lines that Claude would have worked out on its own. Claude Code’s doctor prompt audit checks instruction files, skills and the rest of the setup for outdated or conflicting instructions.
Skills can accumulate too, and their descriptions add to what loads in a session even when the full skills are not used. Claude Code’s skill doctor reports each skill’s cost and usage, including skills never used and where to turn them off; the documentation recommends trimming the most costly first. Anthropic says the skill-creator plugin can also trim skills and remove overlapping ones.
Test Each Change Before Removing Another Agent
Reducing agent count can make a workflow faster without preserving every result. In Anthropic’s sample support agent, folding a subagent into the main agent increased speed, but a previously successful step failed in one run out of two.
Anthropic advises running the same 10 tasks from your own work before and after a change, then checking which ones went from working to broken. AI Labs recommends running each task more than once. The skill-creator plugin can run tests in fresh subagents and compare results with and without a skill.
Start with a small test and fold one subagent into the main session. Keep the subagent separate if the folded version performs worse, then repeat the process with the next agent. Before acting on a subagent’s answer, Anthropic recommends checking it against the actual files or results, including checking a reviewer’s findings against the code before a merge.
In our view, the most useful idea is that a sub-agent should have to earn its place. Treating each one as a cost to justify, not a free helper, is a better habit than any single setting. Repeated file reading adds to usage, while a separate reviewer can inspect the result without the builder’s reasoning in its context. We would be wary of merging everything into one session on faith. Before cutting agents, check that a reviewer still sees the work with fresh eyes, since the saving is only worth it if quality holds.
AI Labs favors a leaner Claude Code workflow, provided the savings do not come at the expense of work quality. If you want your coding allowance to go further, this approach to organizing Claude Code sessions is well worth trying.
Media Credit: AI LABS
Disclosure: Some of our articles include affiliate links. If you buy something through one of these links, Geeky Gadgets may earn an affiliate commission. Learn about our Disclosure Policy.