To pick a subagentās model in Claude Code, add the model field to its definition file, with haiku, sonnet, opus, fable, inherit or a full ID such as claude-haiku-5-5. Without it, the subagent runs on your conversationās model. On the Anthropic API, the sonnet alias has pointed to Sonnet 5.5 since v2.1.284, and the haiku alias to Haiku 5.5 since v2.1.293.
If subagents are new to you, start with how subagents work in Claude Code. For your main model, read Opus 5.5 in Claude Code, and to set how hard each subagent thinks, see the effort level guide.
How much do Haiku 5.5, Sonnet 5.5 and Opus 5.5 cost?
Anthropic API prices, in dollars per million tokens.
| Model | Input | Output | Cache read |
|---|
| Opus 5.5 | $4 | $20 | $0.20 |
| Sonnet 5.5 | $2 | $10 | $0.10 |
| Haiku 5.5, prompts up to 100,000 tokens | $0.10 | $0.50 | $0.01 |
| Haiku 5.5, prompts over 100,000 tokens | $0.50 | $2.50 | $0.05 |
Sonnet 5.5 came out on September 28, 2026, and its cache read price dropped from $0.20 to $0.10 on October 7. Haiku 5.5 launched that same October 7, with a 1M token context window and up to 128k output tokens.
Haiku 5.5ās tier is set per request. A request whose prompt is over 100,000 tokens pays the higher price, cache reads included. A subagent that builds up a long history ends up paying five times more on every turn. On a subscription, usage counts toward your planās limits instead of being billed per token.
Which model fits which subagent?
The docs describe haiku as the fast, efficient model for simple tasks, sonnet for daily coding and opus for complex reasoning. Anthropic says Haiku 5.5 pairs well with Opus 5.5 and Sonnet 5.5 as a subagent on coding work.
| Subagent role | Model to try |
|---|
| Finding files, reading logs, summarizing | haiku |
| A scoped change, writing tests | sonnet |
| Reviewing an architecture, chasing a subtle bug | opus or inherit |
Measure before you roll it out. Run the same task on two models and compare the result and the token use in /usage.
How do you set a subagentās model?
Put the field in the fileās frontmatter, under .claude/agents/ for the project or ~/.claude/agents/ for all your projects.
---
name: log-reader
description: Reads log files and summarizes the errors it finds
tools: Read, Grep, Glob
model: haiku
---
Claude Code resolves the model in this order.
- The model Claude passes when it starts that specific subagent
- The definitionās
model field, where inherit means the main model
- The
CLAUDE_CODE_SUBAGENT_MODEL variable
- Your conversationās model
An alias from the same family as your main model resolves to your exact model. If you work on claude-opus-5, a model: opus subagent also runs on Opus 5, with the same context window. To check, run /tasks while a subagent runs, and its row shows the model plus its effort level if it has one.
How do you run the Explore agent on Haiku?
The built-in Explore agent, which searches your code, runs on your conversationās model. The exception is a conversation on Fable with a Claude subscription, a Console account or an LLM gateway set through ANTHROPIC_BASE_URL, where Explore moves to the model behind the opus alias. It ran on Haiku before v2.1.198.
To put it back on Haiku, create your own subagent named Explore at the user or project level. According to the docs, it overrides the built-in and keeps its own model field.
---
name: Explore
description: Fast read-only search through the codebase
tools: Read, Grep, Glob
model: haiku
---
Write your own search instructions below the frontmatter, since your definition replaces the original one. CLAUDE_CODE_SUBAGENT_MODEL alone doesnāt change the model for Explore or Plan.
How do you force one model on every subagent?
CLAUDE_CODE_SUBAGENT_MODEL only sets a default. A definitionās model field and the model Claude passes at launch both win over it. To enforce it everywhere, Explore included, add CLAUDE_CODE_SUBAGENT_MODEL_FORCE (v2.1.257).
{
"env": {
"CLAUDE_CODE_SUBAGENT_MODEL": "haiku",
"CLAUDE_CODE_SUBAGENT_MODEL_FORCE": "1"
}
}
With that variable on, Claude Code ignores the model field in definitions. Forks stay on the main model. For workflow agents only, CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL has existed since v2.1.296.
How do you set a subagentās effort and compaction?
Two fields go with model. effort sets the subagentās reasoning level, from low to max. autoCompactWindow (v2.1.296) makes it compact earlier, with a value from 100,000 to 1,000,000 tokens.
---
name: log-reader
description: Reads log files and summarizes the errors it finds
model: haiku
effort: low
autoCompactWindow: 100000
---
By default, a session on Haiku 5.5 compacts at about 967,000 tokens. With autoCompactWindow: 100000, the subagent compacts when its context reaches 100,000 tokens, the point past which Haiku 5.5 switches to the higher price tier. Write a plain integer, because in frontmatter Claude Code reads 100k as 100 and ignores the value.
What about subagents still on Sonnet 4.5?
On September 30, 2026, Anthropic announced that claude-sonnet-4-5-20250929 retires from the Claude API on November 30, 2026, and recommends claude-sonnet-5-5. Search your agents/ folders for that ID and replace it.
On Amazon Bedrock, Google Cloudās Agent Platform and Microsoft Foundry, the sonnet alias still points to Sonnet 4.5 and haiku to Haiku 4.5. A model: haiku subagent there doesnāt run on Haiku 5.5. Put your providerās model ID in the field, or set ANTHROPIC_DEFAULT_HAIKU_MODEL. Bedrock and Google-managed Google Cloud follow their own retirement schedules.
Section 7.6 of module 7, Optimization and pro workflow shows how to isolate an investigation in a subagent. To compare model families before you split the roles, module 1, Models and CLI overview walks through them.