Claude Code using too many tokens? Check your subagents
Subagents are meant to save context: they do the heavy reading in their own window and send back a short summary. But a big collection of installed agents costs tokens on every request, even when none of them runs. And when one does run, it uses your main model, Opus included, unless you say otherwise. If your Claude Code bill or usage limit drains faster than your work explains, here's how to check, the five usual causes, and the fix for each.
Calling Claude from your own code instead? See Claude prompt caching not working?
1. Check what loads before you type
Start a fresh session and run /context. It breaks the context down by category. Look at the Custom agents line: that's the name and description of every subagent you have installed, and it rides along on every request so Claude can decide when to delegate.
Then count what's installed. Subagents come from three places, and all of them load at once:
ls ~/.claude/agents | wc -l # your agents, in every project
ls .claude/agents | wc -l # this project's agents
ls ~/.claude/plugins # plugins can add agents tooClaude Code also warns you at startup when the combined descriptions of your subagents (not counting the built-in ones) pass 15,000 tokens. If you've seen that warning, this guide is for you. All the agents still load; the warning is just telling you what they cost.
2. The five usual causes
You installed a whole agent library
Agent collections are easy to install all at once. When we audited agency-agents on 29 November, its default install put 283 agents into ~/.claude/agents. Their descriptions add up to about 74,000 characters, roughly 19,000 tokens (our estimate from character counts). That's over Claude Code's 15,000-token warning, and it's sent with every message in every project, whether or not you ever use the marketing or sales agents.
Most of it is read from cache, so it isn't billed at the full input price. But it still costs something on every request, it's written to the cache again at a higher rate whenever a session starts or the cache expires, and it takes up room in your context window.
Every subagent runs on your main model
A subagent with no model: line uses whatever the main conversation runs on. In an Opus session, that means your docs writer, test runner and file searcher all run on Opus too. Claude Code picks a subagent's model in this order:
- a model Claude passes when it starts that subagent
- the
model:field in the agent's file (inheritmeans the main model) - the
CLAUDE_CODE_SUBAGENT_MODELenvironment variable - the main conversation's model
Most agent libraries don't set model:, so you fall through to step 4. None of the 283 agency-agents files set it.
Each subagent loads its own copy of CLAUDE.md
Custom subagents and the general-purpose agent start with your CLAUDE.md files and a git status snapshot, the same as the main session. Only the built-in Explore and Plan agents skip them. A 5,000-token CLAUDE.md is fine once, but it's paid again for every subagent Claude starts, and some tasks start several at a time.
Agents get every tool, and sometimes whole skills
Without a tools: line, a subagent inherits every tool from the main conversation, MCP tools included. Claude Code now defers full MCP schemas until a tool is needed, so this matters less than it used to, but a writing agent still doesn't need Bash and your database server. The skills: field is heavier: it puts the full text of each listed skill into the subagent's context at startup, not just the description.
Subagents send back long reports
Only a subagent's final answer comes back to your main conversation. That's the point of using one, but if the answer is a 3,000-word report, those tokens stay in your context for the rest of the session and are re-read on every later request.
3. The fixes
Install only the agents you use
Keep a handful in ~/.claude/agents, and move project-specific ones into that project's .claude/agents, so they only load there. Most libraries can install part of the collection. For agency-agents:
./scripts/install.sh --tool claude-code --division engineering,testingKeep each description to a sentence or two about when to use the agent. Put everything else in the body of the file: the body is the agent's system prompt, and it only loads when the agent actually runs.
Give cheaper work a cheaper model
---
name: docs-writer
description: Use after code changes to update README and docstrings.
model: sonnet
tools: Read, Write, Edit, Grep, Glob
---Use sonnet (or haiku) for writing, searching, test runs and summaries, and keep inherit or opus for the agents that do hard design, debugging or security work. Test a few real tasks after the switch, since this changes quality as well as cost.
To set a default for every agent that doesn't name a model, set CLAUDE_CODE_SUBAGENT_MODEL=sonnet. It doesn't override an agent's own model: line, and it doesn't change the built-in Explore and Plan agents. To force one model onto every subagent, also set CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 (Claude Code v2.1.257 or later). To run the built-in file search on a cheaper model, create your own agent named Explore with model: haiku. It replaces the built-in one.
Leave CLAUDE.md out where it isn't needed
For agents that get everything they need from the task Claude hands them (a reviewer of one diff, a translator, a summariser), add omitClaudeMd: true to the frontmatter (Claude Code v2.1.271 or later). And keep CLAUDE.md itself short, since every session and most subagents load it.
Narrow the tools
List only the tools an agent needs in tools:, and add skills to skills: only when the agent needs the whole skill on every run. It can still load other skills itself when a task calls for them.
Ask for short answers
End each agent's system prompt with something like "Reply with a summary of under 200 words: what you found, what you changed, and anything that needs a decision." Your main context stays small, and so does every request after it.
Switch off agents you can't uninstall
To stop Claude from using an agent, for example one a plugin installed, add it to permissions.deny in your settings:
{
"permissions": {
"deny": ["Agent(unused-agent-name)"]
}
}This stops Claude from starting the agent. To save the description tokens as well, remove the file or turn off the plugin.
What it saves
Take the 283-agent install above: about 19,000 tokens of descriptions on every request. Assume one developer, 22 working days a month, 150 to 300 requests a day, and 8 to 15 cache writes a day (new sessions, plus the cache expiring after a break). At Anthropic's list prices, with cache reads at 5% of the input price and cache writes at 1.25 times (Anthropic's 5-minute cache):
| Main model | Input / cache read per 1M | Agent list cost per developer per month |
|---|---|---|
| Claude Opus 5.5 | $4 / $0.20 | about $29 to $55 |
| Claude Sonnet 5.5 | $2 / $0.10 | about $14 to $28 |
Cutting that down to about 30 agents you actually use removes roughly 90% of it. Moving routine subagents from Opus to Sonnet halves what those subagents cost, since Sonnet 5.5 is half Opus 5.5's price on both input and output. On a Pro or Max plan you don't pay per token, but the same tokens count against your usage limits and your context window.
These figures are estimates. Run /context for the real size of your agent list, which Claude Code may format differently from the raw files.
FAQ
Do Claude Code subagents use more tokens?
Overall, usually yes: each subagent starts its own context with its own system prompt, CLAUDE.md and tools, and does its work there. What they save is room in your main context, because only the final answer comes back. They're worth it for big searches and reviews, and wasteful for small tasks Claude could do in a couple of steps.
What model do Claude Code subagents use?
The model in the agent's model: field if it has one, then CLAUDE_CODE_SUBAGENT_MODEL if you set it, and otherwise the same model as your main conversation.
What does "agent descriptions are over the 15,000 token limit" mean?
The descriptions of your subagents, not counting the built-in ones, add up to more than 15,000 tokens. Claude Code still loads all of them; the warning is there because they're sent with every request. Install fewer agents or shorten their descriptions.
Checklist
- Checked Custom agents in
/context, and under the 15,000-token warning? - Only the agents you use in
~/.claude/agents, project ones in.claude/agents? - Short descriptions, details in the body?
model: sonnetorhaikuon routine agents?tools:narrowed,omitClaudeMd: truewhere CLAUDE.md isn't needed?- Agents asked for short summaries?
Building your own app on Claude? Get a free cost audit of your repo, or run the free LLM cost audit skill yourself. And see what Claude Opus 5.5 costs on each route today.
Sources: Claude Code subagents docs, Claude Code context window docs, our audit of agency-agents (commit 8ae6164), all checked 30 November 2026.