# CLAUDE_CODE_SUBAGENT_MODEL

> It sets the model for helpers that have none.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** CLAUDE_CODE_SUBAGENT_MODEL environment variable

## Think of it like

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

## 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

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.

## Example code

```bash
export CLAUDE_CODE_SUBAGENT_MODEL=haiku
claude
```

Run unassigned helpers on Haiku.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Subagent](https://learn.benibix.com/term/ai/subagent)
- [Built-in Subagents](https://learn.benibix.com/term/ai/built-in-subagents)
- [Agent Teams](https://learn.benibix.com/term/ai/agent-teams)
- [CLAUDE_CODE_SUBAGENT_MODEL_FORCE](https://learn.benibix.com/term/ai/claude-code-subagent-model-force-variable)

## Told apart from

- [CLAUDE_CODE_SUBAGENT_MODEL vs CLAUDE_CODE_SUBAGENT_MODEL_FORCE](https://learn.benibix.com/compare/claude-code-subagent-model-variable-vs-claude-code-subagent-model-force-variable): People think CLAUDE_CODE_SUBAGENT_MODEL sets the model for every helper. It does not. A model in the helper's own file wins over it, and so does a model Claude names when it starts the helper. The FORCE switch, set to 1, flips that order. Then your pick wins over both, and every helper runs on it.

![A subagent takes the first model set in this order. FORCE puts the variable on top.](https://learn.benibix.com/diagrams/env-subagent-model.svg)

---

Source: https://learn.benibix.com/term/ai/claude-code-subagent-model-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
