Claude Code made Opus 5 its default engine on July 24. That upgrade is real — but it comes with a catch most teams hit about two weeks in: every subagent you spawn inherits the session model. Run a dozen agents on Opus and you’re burning flagship tokens on tasks that Haiku could handle. One team cut token spend by 60% just by setting two fields in their agent frontmatter. Here is how to do it.
Two Fields, Completely Different Bills #
Subagent files in Claude Code are Markdown files with YAML frontmatter. Most developers set name
, description
, and tools
— and leave everything else at defaults. The defaults inherit from the parent session. If your session runs on Opus 5, every subagent runs on Opus 5. That is the quiet budget problem.
Two fields break the inheritance:
— acceptsmodel
haiku
,sonnet
,opus
,fable
, or a full model ID. Defaults toinherit
.— acceptseffort
low
,medium
,high
,xhigh
,max
. Defaults to inheriting from the session too.
Set them in frontmatter and they stick — regardless of what the main session is running. A subagent declaring effort: medium
runs at medium inside a session running at max. That override is not a default the session can talk it out of.
The Routing Rule #
The mistake is routing by task category (“code = Sonnet, docs = Haiku”). The better rule is routing by decision complexity:
Structured lookups, yes/no extractions, file reads→ Haiku + low effort** Code generation, test writing, tool-heavy execution→ Sonnet + medium effort Security audits, architecture decisions, ambiguous multi-step reasoning**→ Opus + high effort
The distinction matters because effort affects tool calls, not just output length. At lower effort, the model makes fewer tool calls, skips preambles, and returns terser results. For a file-explorer agent that just needs to surface a list of paths, that is a feature, not a bug.
Three Agents to Drop In Today #
These go in .claude/agents/
inside your project (or ~/.claude/agents/
to make them available everywhere). Check them into version control so your team gets them automatically.
File exploration — Haiku, low effort:
---
name: file-explorer
description: Search codebase for files, patterns, and structure. Use for any file discovery task.
tools: Read, Glob, Grep
model: haiku
effort: low
---
Search and return concise, structured results. No explanation needed.
Test runner — Sonnet, medium effort:
---
name: test-runner
description: Write and run unit tests after feature implementation.
tools: Read, Write, Bash, Glob
model: sonnet
effort: medium
---
Write focused, working tests. Run them. Report results concisely.
Security auditor — Opus, high effort:
---
name: security-auditor
description: Security review, OWASP compliance, RLS policy validation. Use before merging security-sensitive changes.
tools: Read, Grep, Glob
model: opus
effort: high
---
Perform thorough security analysis. Flag critical issues first. Provide remediation steps.
The opusplan Shortcut #
If you do not want to manage this granularly, there is a built-in hybrid: set model: opusplan
in your agent’s frontmatter or session settings. Claude Code runs Opus during plan mode for architecture and task breakdown, then switches automatically to Sonnet for execution. Not as fine-grained as the three-tier approach above, but it costs nothing to set up and beats running everything on Opus by default.
The Trap: Startup Costs #
One counterintuitive finding: each subagent instance costs roughly 25–35k tokens just to initialize its context. If you over-fragment work — spawning 15 micro-agents where 4 focused ones would do — the startup overhead wipes out the savings from cheaper models.
Batch related tasks into a single subagent rather than spawning one agent per file or per domain. A Haiku agent that handles 10 file lookups in one pass is cheaper than 10 Haiku agents that each look up one file.
What “Effort” Actually Controls #
Effort does not reliably shorten the visible output — on Opus 5, it often does not shorten it at all. What it controls is thinking depth and tool call volume. Lower effort means the model thinks less, calls fewer tools, and proceeds more directly to action.
That makes effort: low
the right choice for subagents doing deterministic work and effort: high
the right choice for anything requiring judgment. Setting effort: xhigh
on a Haiku agent is a contradiction — Haiku does not have the reasoning capacity to benefit from extended thinking at that level. The official effort documentation has the full breakdown by model.
Put It in Place Once #
The leverage here is that this is configuration, not continuous judgment. Write the frontmatter once, commit it, and every subsequent run routes automatically. Teams using this approach report 60% cost reduction on comparable workloads — not because they downgraded quality, but because they stopped paying Opus prices for tasks that need Haiku-level work.
The Claude Code subagents documentation has the full frontmatter field reference, and the model configuration docs cover alias resolution across providers — Bedrock, Google Cloud, and Microsoft Foundry all resolve aliases differently, which matters if you run Claude Code in CI or on third-party infrastructure.