Expand description
Which model a Claude agent’s sub-agents run on (SPEC_SUBAGENT_MODELS_2026_10_25.md).
Which model a Claude agent’s sub-agents run on
(docs/specs/SPEC_SUBAGENT_MODELS_2026_10_25.md).
Sub-agents were about a quarter of the fleet’s spend and almost all of their calls ran on the biggest model, because a sub-agent inherits its parent’s model. Measured on Claude Code 2.1.288:
CLAUDE_CODE_SUBAGENT_MODELmoves general-purpose sub-agents (and custom ones with no model of their own). It is set at spawn from [SETTING_SUBAGENT], or the pane’s own [META_SUBAGENT]. Without..._FORCE, an agent’s ownmodel:and themodelits parent passes per call still win, so a leader can send a hard question to Opus.- Explore and Plan ignore it and stay on the parent’s model.
Explore is moved by a user-level agent definition named
Explorein the Claude config dir, which beats the built-in: AgentMux writes one ([seed_explore_agent]) from [SETTING_EXPLORE] and removes it again when the setting saysinherit. One a person wrote is left alone.
Constants§
- DEFAULT_
EXPLORE_ MODEL - DEFAULT_
SUBAGENT_ MODEL - META_
SUBAGENT - Block meta that overrides
SETTING_SUBAGENTfor one agent. - SETTING_
EXPLORE agent:exploremodel: the model for Explore sub-agents.- SETTING_
SUBAGENT agent:subagentmodel: the model for general-purpose sub-agents.
Functions§
- carry
- Add
CLAUDE_CODE_SUBAGENT_MODELto a Claude agent’s spawn environment, unless itscmd:envalready sets one. Not for other providers. - explore_
model SETTING_EXPLOREnow, resolved: the model to write, orNonefor none.- resolve
- The model to set, the first level that says something: the pane’s own,
then the setting, then the default.
Nonewhen it saysinherit. - seed_
explore_ agent - Write, or remove, the Explore definition in
config_dir’sagents/folder formodel(Noneremoves AgentMux’s own). Leaves one a person wrote. Returns whether the file changed.