A sub-agent costs before it has done any work
A subagent costs before it has done any work, because its conversation already contains items you did not write, loaded again at every launch. With no tools field it inherits every tool, and with no model named it runs on the same model as you. List its tools and name its model by role.
A subagent is a separate conversation that Claude Code opens for a task. Before its first instruction, that conversation already contains items you did not write, and every launch loads them again. A subagent's cost is therefore made of this startup and of the work requested.
What a subagent contains at the start
The subagents documentation lists, among other things, what it receives: its own system prompt with environment details, every level of CLAUDE.md files the main conversation loads, the full content of the skills named in its skills field, the MCP servers in its mcpServers field, and the start of its memory file if memory is on. For tools, the rule is the reverse of what one assumes: with the tools field omitted, the subagent inherits every tool available. The more items at the start, the heavier the first call.
A custom agent with listed tools
A file placed in .claude/agents/ defines an agent that Claude can launch by name. This one keeps only what its task requires:
---
name: reader
description: Reads files and reports what they contain, without changing anything.
tools: Read, Grep, Glob
model: haiku
---
You read the requested files and report the facts found, with the file name.
You do not judge and you change nothing.
The three listed tools are the only ones this agent can use, and model: haiku gives it a small model. The documentation specifies that Claude Code watches these folders and picks up an added or edited file within a few seconds; after creating the very first file in an agents folder, a session restart is needed.
Naming the model by role
With no model named, the documentation gives this order: the call's parameter, then the model field of the definition, then the CLAUDE_CODE_SUBAGENT_MODEL variable, then the main conversation's model. A subagent that received nothing else therefore runs on the same model as you, with nothing flagging it at launch; the /tasks command shows the model on the subagent's row. A mechanical collection (read, list, extract) can go to a small model; writing and analysis to a mid-size model; the judge, who must refute, to the most capable. The effort level is set the same way: the Agent tool accepts an effort parameter for a given launch, and an agent's definition can set its own.
Measure before concluding
The real weight of each item is read on your own setup, not in an average. The lesson on the bill shows where to read consumption by item; apply it to a default subagent, then to the same work given to the restricted agent.
Which model a subagent takes, in order
| Rank | Source of the model |
|---|---|
| 1 | The model parameter of the call itself. |
| 2 | The model field of the agent's definition (inherit designates the main model). |
| 3 | The CLAUDE_CODE_SUBAGENT_MODEL variable, if set. |
| 4 | The main conversation's model. |
Two agent definitions for the same reading task
No tools or model field: every available tool, and the main conversation's model.
tools: Read, Grep, Glob and model: haiku: three tools and a small model for a task that only reads.
A team configures a Claude Code session with a large CLAUDE.md file and several MCP servers. It launches five subagents to read five configuration files, then reads a total of 4.20 dollars on /cost for this reading task.
Write in one sentence what this situation establishes, and in one sentence what it does not establish.
What this establishes: It establishes that /cost displayed 4.20 dollars after the five subagents were launched, and that this total covers the whole session.
What this does not establish: It does not establish which model each subagent ran on, nor what share of the total comes from their startup: the reading adds up the entire session, and only a comparison on the same task with a restricted agent isolates that share.
The three most common miscalibrations
- Too broad Subagents always cost more than doing the task in the main conversation.
- Too narrow The total read says nothing until the exact token count of each subagent is known.
- Off target The five configuration files read were too long to be read by a subagent.
- A subagent receives at the start its prompt, the CLAUDE.md files, and the skills and MCP servers it is given by name, and each weighs on the first call.
- An omitted tools field gives the agent every available tool: restricting is an explicit act.
- With no model named, a subagent runs on the main conversation's model, nothing flags it at launch, and /tasks displays it.
- The model is split by role: small to collect, mid-size to write, the most capable to judge.
- An agent's startup cost is measured on the same task given first to a default agent and then to a restricted one.
Create an empty test folder, add a three-line notes.txt file to it, then a .claude/agents/reader.md file copied from the example. Start Claude Code in that folder, ask the reader agent to report the content of notes.txt, then type /cost and note the line. Make the same request to an unnamed subagent in a fresh session, and compare the two lines.
Every datable claim in this lesson links here to the public text behind it. A source that does not open proves nothing.
- Claude Code, subagents: model, tools and starting context consultée le 2026-10-24
- Claude Code changelog, version 2.1.292, effort parameter of the Agent tool consultée le 2026-10-24