Agent teams (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS) ignore modelOverrides when spawning subagents
Summary
When agent teams spawn subagent processes via tmux, the --model CLI flag passed to each subprocess uses a hardcoded us.anthropic.* model ID. The modelOverrides mapping defined in settings.json is not applied to this flag, causing 400 errors on Bedrock setups that require a different regional prefix (e.g. eu.).
Environment
- Claude Code version: 2.1.87
- Feature flag:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 - Provider: AWS Bedrock, eu-central-1 via a reverse proxy (
ANTHROPIC_BEDROCK_BASE_URL)
Reproduction
settings.json contains:
{
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1",
"ANTHROPIC_MODEL": "eu.anthropic.claude-sonnet-4-6"
},
"model": "eu.anthropic.claude-sonnet-4-6",
"modelOverrides": {
"us.anthropic.claude-opus-4-6-v1": "eu.anthropic.claude-opus-4-6-v1",
"claude-opus-4-6": "eu.anthropic.claude-opus-4-6-v1"
}
}
Trigger an agent team (e.g. "create an agent team for X"). Claude Code spawns subagents via tmux with commands like:
env CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 \
/Users/fedele1/.local/share/claude/versions/2.1.87 \
--agent-id ... --agent-name ... --team-name ... \
--agent-type general-purpose \
--dangerously-skip-permissions \
--model us.anthropic.claude-opus-4-6-v1
Expected behavior
The spawner should look up us.anthropic.claude-opus-4-6-v1 in modelOverrides before building the subprocess --model argument and pass eu.anthropic.claude-opus-4-6-v1 instead.
Actual behavior
Each subagent starts with --model us.anthropic.claude-opus-4-6-v1 verbatim. The child process does not apply modelOverrides to the CLI-provided model ID, so the API call reaches the gateway with the wrong model string:
API Error (us.anthropic.claude-opus-4-6-v1): 400 The provided model identifier is invalid.
Try /model to switch to us.anthropic.claude-1-20250805-v1:0.
All three spawned agents fail immediately and the team is unusable.
Notes
- The parent session correctly uses
eu.anthropic.claude-sonnet-4-6(set via"model"in settings.json). modelOverridesworks as expected for interactive model selection in the parent session.- The subagent spawn command uses the absolute binary path, so a shell PATH wrapper cannot intercept it.
- The issue is specific to the agent teams spawner not consulting
modelOverrideswhen constructing the--modelflag for child processes.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗