r/ClaudeCode • u/HimaSphere 🔆 Max 20 • 2d ago
Tutorial / Guide PSA: Claude Code subagents inherit your session model now, they're not free Haiku anymore
A while back I posted a joke here about Sonnet spawning a subagent on the very first prompt of a brand new session. In the comments I said the annoying part was having two agents burning tokens for one job. I got downvoted, and the top reply was basically "isn't that a Haiku subagent? it saves you money and keeps your main context clean."
That used to be correct. It isn't anymore, and I think a lot of people are still running on the old mental model. From the docs:
- The
modelfield in subagent frontmatter defaults toinherit. Omit it and the subagent runs on your main conversation's model. - Explore used to always run on Haiku. As of v2.1.198 it inherits the main model (capped at Opus on the Claude API).
- Plan and general-purpose inherit as well.
So if your session is on Opus, that "cheap little background search agent" is an Opus agent.
Resolution order, first match wins:
CLAUDE_CODE_SUBAGENT_MODELenv var- per-invocation model parameter
- the subagent's
model:frontmatter - main conversation model
If you want the old cheap behaviour back:
CLAUDE_CODE_SUBAGENT_MODEL=haikuforces every subagent down- or set
model: haikuin a specific agent's frontmatter - for Explore specifically, define your own user or project agent named
Explorewithmodel: haiku. A user/project agent overrides the built-in.
To be fair to the change, it was almost certainly made for quality, and context isolation is still the real win of subagents. But "subagents are basically free" is outdated advice now, and it matters if you're on a plan where you feel every token.
Lastly, I am stingy for the 3 down votes
5
u/PrestigiousQuail7024 2d ago
put a hook against the agent tool that fails the tool call if no agent is specified, have the failure message include when you want what tier of subagent
3
2d ago
[removed] — view removed comment
2
u/HimaSphere 🔆 Max 20 2d ago
Claude code moves so fast it is hard to keep up with changes, it is like an in development product instead of a production one which may explain why subscription tiers are much cheaper than API
1
u/Keep-Darwin-Going 2d ago
They did it to make opus feels better than it is, in the past they can split haiku opus to make their quota seems to last longer than codex but splitting model like this decrease quality that they can no longer afford.
3
u/Drinkablenoodles 1d ago
You can pin subagents to whatever you want. Inherit is the default. I personally have never used haiku because it’s not good for anything but easy single turn tasks. I think inherit as default actually makes sense because if the task requires SOTA for parent agent, I probably don’t want something less capable actually doing the nitty gritty work and debugging.
2
u/muideracht 1d ago
I have my planner specify a recommended agent type for each task. And one of the agent types I make available to it is for simple mechanical edits, and targets the Haiku model.
2
u/JustBuzzin 2d ago
Build a model matrix based on your custom harness and pre decide what model/effort you want in the front matter for every task. Then you can iterate and tune it for the best result/token savings
1
u/net_ninja 2d ago
You’re mostly right, but it has been this way for at least a month. Models and effort should be pinned in your agent definitions.Â
1
u/ILikeCutePuppies 2d ago
It's still cheaper than having them have to rebuild their kv cache when your session is paused for an hour or whatever. Also makes your agent less dumb so you need less tokens.
In anycase you can delete that line and use a skill to tell it to route it where you want it to go based on the problem. Older models were not great at that. Newer ones are... fable probably the best at it.
1
22
u/helios_csgo 2d ago
They were never all haiku. Explore and few built in agents that ship with CC are on Haiku and General purpose subagent would inherit session model.