Claude Code subagents: when they save context and money
A subagent is a second Claude with its own context window
A Claude Code subagent is a separate Claude that takes one side task, works on it in its own context window with its own instructions and tools, and hands back only a summary. That keeps search results, logs and file dumps out of your main conversation. It does not make the work free: Anthropic's docs say a subagent sends its own requests, which count toward the same usage limits as your main session.
So the honest way to think about subagents is as a context tool first and a cost tool second. They pay off when a task would otherwise fill your main window with material you will never look at again, and when that task can run on a smaller, cheaper model. They cost you when they are used for work the main conversation could have done in a few steps.
If your Claude Code usage keeps climbing as you add agents, we can help you work out which ones are paying for themselves. Book a call with GenovaFlow AI
Claude Code ships its own subagents and uses them unasked
You are probably using subagents already. Claude Code ships with built in subagents that it calls on its own, and these three are the ones you will meet most:
- Explore is a fast, read only agent for searching and understanding a codebase. Write and Edit are denied to it, and Claude asks it for a quick, medium or very thorough search.
- Plan does the research while you are in plan mode, so the exploration stays out of the main window while that window remains read only.
- General purpose has every tool available to subagents and takes multi step work that needs both exploring and changing things.
Explore and Plan also start without your CLAUDE.md files and the git status snapshot, which keeps them quick and cheap. Every other subagent loads both, unless its definition says otherwise. That detail matters later, because everything a subagent loads at the start is part of what it costs.
Delegate verbose, self contained work, and keep the rest
The test is simple: delegate a task when it produces a lot of output you do not need, can run on its own, and can come back as a summary. Anthropic's list of when to stay in the main conversation is just as useful: back and forth refinement, several phases that share a lot of context, quick targeted changes, and anything where waiting matters, because a subagent starts fresh and has to gather its own context.
Anthropic's own guide on how and when to use subagents puts numbers on it: exploring ten or more files, or three or more independent pieces of work, is a strong signal to delegate. Smaller or tightly sequential tasks are usually simpler in the main conversation. The classic good fit is a test run or a log file. The docs suggest a prompt as plain as this, and the failing tests come back without the thousands of passing lines around them:
Use a subagent to run the test suite and report only the failing tests with their error messagesSubagents spend tokens of their own
A subagent saves space in your main window, not necessarily tokens overall. Each one reads its own instructions, its CLAUDE.md files and whatever it explores, and all of that is billed. Anthropic's costs guide says it directly: the verbose output stays in the subagent's context, and "the subagent's own requests still draw on your usage."
At scale the difference is large. When Anthropic built its multi agent research system, it found that agents typically use about 4 times more tokens than chat, and multi agent systems about 15 times more. That system beat a single agent by 90.2 percent on Anthropic's internal research eval, and the same post says the approach only makes sense where the task is valuable enough to pay for it. It also notes that most coding tasks involve fewer truly parallel pieces than research does.

Agent teams, where several Claude Code sessions work together, are heavier again: the costs guide puts them at about 7 times the tokens of a standard session when teammates run in plan mode. If you are on a plan with usage limits, that is the number to remember before you ask for a team of reviewers.
Two settings bring the cost down. Give simple subagents a smaller model, which the costs guide recommends with model: haiku in the subagent's definition, and keep descriptions short, because every subagent's description sits in your main context so Claude knows when to use it. Claude Code warns at startup once your custom subagents' descriptions pass 15,000 tokens combined. For how model sizes and prices compare in general, see how large language models differ.
Define one in a short Markdown file
A subagent is a Markdown file with a short header. Only name and description are required, and the text below the header becomes the subagent's instructions. Here is an example of a read only log reader on the cheapest model, written to the frontmatter reference:
---
name: log-reader
description: Reads long log files and test output and reports only the errors that matter. Use when a log is too long to read in the main conversation.
tools: Read, Grep, Glob
model: haiku
---
You read logs and test output. Report each distinct error once:
the message, the file and line if there is one, and how many
times it appeared. Do not paste the raw log. Do not edit files.Save it as .claude/agents/log-reader.md to share it with everyone on the project through version control, or as ~/.claude/agents/log-reader.md to have it in all your own projects. You can also ask Claude to write the file for you and then check what it produced. Where a name is defined twice, the higher priority location wins:

Claude delegates on its own when a task matches the description, and adding "use proactively" to the description makes that more likely. To be certain, name it in your prompt, mention it with @, or start a whole session as that agent with claude --agent log-reader. The model order is worth knowing too: a model Claude passes for one run beats the file's model field, which beats the CLAUDE_CODE_SUBAGENT_MODEL setting, which beats the main conversation's model.
Use the tool list to keep risky tools in one place
Subagents are also a safety tool. A subagent with no tools line inherits every tool the main conversation has, including MCP tools. Listing tools turns that into an allowlist, and the docs' own example of Read, Grep, Glob, Bash produces a subagent that cannot edit or write files or use any MCP tools. Keep in mind that Bash can still change files through the shell, so a strictly read only agent leaves it out, as the log reader above does.
The same idea works for MCP servers. A server defined inside a subagent's file, rather than in your project's config, connects when that subagent starts and disconnects when it finishes, and its tool descriptions never enter the main conversation. The docs use a browser tester with Playwright as the example:
---
name: browser-tester
description: Tests features in a real browser using Playwright
mcpServers:
- playwright:
type: stdio
command: npx
args: ["-y", "@playwright/mcp@latest"]
- github
---
Use the Playwright tools to navigate, screenshot, and interact with pages.That pattern suits a business that wants one narrow agent allowed to touch a browser, a database or a ticketing system while the main session stays without that access. Inline servers from a project's agent files only load once you trust the folder, and plugin subagents ignore the mcpServers, hooks and permissionMode fields entirely.
Know the limits before you build a team of them
A few limits shape how far subagents go. Each one starts with a fresh context and does not see your conversation history, so anything it must know has to be in the task Claude writes for it. Subagents also cannot talk to each other; Anthropic's guide points work that needs coordination to agent teams, which cost more.
By default a subagent Claude spawns runs in the background while you keep working, and its permission prompts surface in your main session. Subagents can spawn their own up to three layers deep, and a session stops spawning more once 20 are running at the same time. Those defaults are generous, which is exactly why the cost section above matters.
Used well, subagents are one of the cheaper ways to keep long sessions healthy, next to the habits in eleven fixes that cut our Claude Code token usage. If you are new to the idea of agents that pick their own next step, what agentic AI is covers the loop underneath. More guides are in the Claude Code section, and if your team's usage keeps climbing as you add agents, that is the kind of setup we review in our custom AI agent work.
Questions people ask
Do Claude Code subagents use more tokens?
Usually, yes, in total. A subagent keeps your main window smaller, but it reads its own instructions and files and its requests count toward the same usage limits. Anthropic measured multi agent systems at about 15 times the tokens of a chat. Running simple subagents on a smaller model such as Haiku is the main way to keep the cost down.
Can Claude Code subagents talk to each other?
No. Each subagent reports back to the main conversation, which passes whatever the next one needs. Anthropic's guide to subagents points work that needs agents to coordinate directly to agent teams, which are separate Claude Code sessions and use considerably more tokens.
What is the difference between subagents and skills in Claude Code?
A skill is a set of reusable instructions that runs inside your main conversation and its context. A subagent runs in its own separate context window with its own prompt and tool list, and returns a summary. The subagents docs suggest a skill when you want a reusable workflow in the main context, and a subagent when the work is verbose or needs its own restrictions.
Can a Claude Code subagent use a different model?
Yes. Set model in the subagent's file to haiku, sonnet, opus, a full model ID or inherit. Claude can also pass a model for a single run, which takes priority. The model order in the docs explains which setting wins, and /tasks shows which model a running subagent is on.
Does Claude Code use subagents automatically?
Yes. It delegates to the built in Explore and Plan agents on its own, and to your custom subagents when a task matches their description. Adding "use proactively" to a description encourages it. To force a particular one, name it in your prompt or mention it with @, as the docs describe.