claude-code - 💡(How to fix) Fix [DOCS] `CLAUDE_CODE_SUBAGENT_MODEL` docs do not explain agent-teams teammate behavior

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Because agent teams are documented separately from subagents, the current docs do not tell readers that this environment variable also affects teammate processes created by agent teams, or how that behavior relates to teammate model selection via /config, spawn-prompt model instructions, or a referenced subagent definition's model.

RAW_BUFFERClick to expand / collapse

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/model-config

Section/Topic

CLAUDE_CODE_SUBAGENT_MODEL in the Model configuration environment-variables table, with a cross-reference from the agent-teams model-selection section

Current Documentation

The docs currently say:

CLAUDE_CODE_SUBAGENT_MODEL | The model to use for all subagents. Overrides both the per-invocation model parameter and the subagent definition's model frontmatter

The agent-teams guide also says:

Teammates don't inherit the lead's /model selection by default. To change the model used when the prompt doesn't specify one, set Default teammate model in /config. Pick Default (leader's model) to have teammates follow the lead's current model.

And later:

The teammate honors that definition's tools allowlist and model, and the definition's body is appended to the teammate's system prompt as additional instructions rather than replacing it.

What's Wrong or Missing?

Claude Code v2.1.147 fixed CLAUDE_CODE_SUBAGENT_MODEL not applying to teammate processes spawned by agent teams, but the docs still describe that variable only in subagent terms.

Because agent teams are documented separately from subagents, the current docs do not tell readers that this environment variable also affects teammate processes created by agent teams, or how that behavior relates to teammate model selection via /config, spawn-prompt model instructions, or a referenced subagent definition's model.

Suggested Improvement

Add one explicit note to the CLAUDE_CODE_SUBAGENT_MODEL row in the model-config page stating that, as of v2.1.147, the variable is also propagated to teammate processes spawned by agent teams.

Add a matching note in the agent-teams "Specify teammates and models" section clarifying whether this environment variable overrides or interacts with:

  • teammateDefaultModel
  • explicit teammate model instructions in the spawn prompt
  • a referenced subagent definition's model

A short precedence note or table would make multi-agent model configuration much easier to reason about.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageLine(s)Context
https://code.claude.com/docs/en/model-config296-302CLAUDE_CODE_SUBAGENT_MODEL is documented only as a subagent override
https://code.claude.com/docs/en/agent-teams123-132Teammate model selection only mentions spawn instructions and Default teammate model
https://code.claude.com/docs/en/agent-teams240-248Teammates created from subagent definitions are said to honor that definition's model
https://code.claude.com/docs/en/sub-agents293-298Subagent model-resolution order lists CLAUDE_CODE_SUBAGENT_MODEL without linking that behavior to agent teams

Total scope: 4 pages affected

Version context: changelog entry in v2.1.147 says: Fixed CLAUDE_CODE_SUBAGENT_MODEL not applying to teammate processes spawned by agent teams.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [DOCS] `CLAUDE_CODE_SUBAGENT_MODEL` docs do not explain agent-teams teammate behavior