Skip to content
BENIBIX Learn

CLAUDE_CODE_SUBAGENT_MODEL

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_SUBAGENT_MODEL environment variable

It sets the model for helpers that have none.

Think of it like

It is like the shoes you hand a helper who did not bring any.

Example

Jack works on Opus but wants cheap helpers. He sets this to haiku, and every subagent with no model of its own runs on Haiku.

Why it matters

Helpers can run on a cheaper model while the main chat stays on a strong one.

Definition

CLAUDE_CODE_SUBAGENT_MODEL sets the model for helper agents that do not get one some other way. That means subagents, teammates and workflow agents. Two things win over it. One is a model Claude names when it starts the agent, and the other is a model in the agent's own file. It takes an alias such as haiku, or a full name. Set to inherit, it is the same as not set.

Example code

bash
export CLAUDE_CODE_SUBAGENT_MODEL=haiku
claude
Run unassigned helpers on Haiku.
The variable is third, unless FORCE is set.

Common mistake

Expecting it to change Explore and Plan. Those built-in helpers need the FORCE variable too.

Key takeaways

  1. 1
    Fills the gap. Agents with no model.
  2. 2
    Two things beat it. The call and the file.
  3. 3
    inherit means unset. Same as leaving it out.

Compare