Agent Teams: Spawned teammates don't inherit model configuration from team lead

Open 💬 17 comments Opened Mar 9, 2026 by gavinyao

Summary

When using Agent Teams with a custom/internal model endpoint, spawned teammates fail to inherit the model configuration. The team lead works correctly with the configured model, but teammates attempt to use a different model ID (claude-opus-4-6), resulting in 403 permission errors.

Environment

  • Claude Code version: Latest (March 2026)
  • OS: macOS Darwin 24.6.0
  • Shell: zsh
  • Model configured: Internal/custom endpoint (e.g., internal-model-opus-aws)

Steps to Reproduce

  1. Configure Claude Code to use a custom/internal model endpoint
  2. Enable Agent Teams experimental feature:

``json
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
``

  1. Create a team:

``
TeamCreate with team_name: "test-team"
``

  1. Spawn teammates:

``
Agent with subagent_type: "general-purpose", team_name: "test-team"
``

  1. Send tasks to teammates via SendMessage

Expected Behavior

Teammates should inherit the same model configuration as the team lead and execute tasks normally.

Actual Behavior

  • Team lead works correctly with the configured internal model
  • Teammates repeatedly send idle_notification without executing any tasks
  • Teammates' API calls fail with 403 error:
API Error: 403 {
  "error": {
    "code": "",
    "message": "Token does not have permission to access model claude-opus-4-6",
    "type": "new_api_error"
  }
}

Analysis

| Role | Model Used | Result |
|------|------------|--------|
| Team Lead | internal-model-opus-aws (from config) | ✅ Works |
| Teammates | claude-opus-4-6 (hardcoded?) | ❌ 403 Error |

The teammates appear to use a hardcoded or default model ID (claude-opus-4-6) instead of inheriting from the team lead's configuration or the global settings.

Impact

Users with custom/internal API endpoints cannot use the Agent Teams feature at all. This blocks adoption for enterprise users or those using proxy endpoints.

Suggested Fix

Ensure spawned teammates inherit the model configuration from:

  1. The model parameter passed to the Agent tool, OR
  2. The team lead's current model configuration, OR
  3. The global settings.json configuration

Workaround Attempted

Tried specifying model: "haiku" or model: "sonnet" in the Agent tool parameters, but the issue persists (teammates still attempt to use claude-opus-4-6).

View original on GitHub ↗

17 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/29660
  2. https://github.com/anthropics/claude-code/issues/25094
  3. https://github.com/anthropics/claude-code/issues/23561

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

junaidtitan · 4 months ago

Hitting this too with custom endpoints. We've added a doctor check for this in Cozempic v0.9.0:

pip install -U cozempic
cozempic doctor  # warns if agent teams are active but no model set in settings.json

The check detects when ~/.claude/settings.json is missing a model key while team directories are present — since that's the condition where subagents silently fall back to claude-opus-4-6 instead of inheriting the team lead's config.

Workaround until fixed upstream: add "model": "your-model-id" explicitly to ~/.claude/settings.json. That ensures subagents pick it up rather than relying on env var inheritance which appears broken.

gavinyao · 4 months ago

thans for reply, but It's not work for me.

Claude Code v2.1.71

❯ cozempic --version
cozempic 0.9.0

❯ cozempic doctor

COZEMPIC DOCTOR
═══════════════════════════════════════════════════════════════════

✓ trust-dialog-hang [OK]
Trust dialog flag not set — no issue

✓ hooks-trust-flag [OK]
Hooks trust flag set correctly — hooks will load normally

✓ claude-json-corruption [OK]
.claude.json is valid (25160 bytes)

✓ corrupted-tool-use [OK]
No corrupted tool_use blocks found (132 sessions checked)

✓ orphaned-tool-results [OK]
No orphaned tool_result blocks found (132 sessions checked)

✓ zombie-teams [OK]
4 active team(s), no stale teams found

✓ agent-model-mismatch [OK]
Model 'internal-model-opus-aws' set in settings.json — subagents should inherit correctly

✓ oversized-sessions [OK]
No oversized sessions found (132 sessions checked)

✓ stale-backups [OK]
No stale backup files found

✓ disk-usage [OK]
132 sessions using 49.5MB total

All clear — no issues found.

MasterXue · 4 months ago

https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2172

  • Fixed team agents to inherit the leader's model

2.1.72 fix the bug, but I haven't verified it yet.

it235 · 4 months ago
2.1.72 fix the bug, but I haven't verified it yet.

I also noticed this fix, but I spent 3 hours researching version 2.1.72 and the issue still exists and has not been fixed

@team-lead> code-review
⎿  API Error: 400 event:error
data:{"code":"InvalidParameter","message":"model 'claude-opus-4-6' not found or not
supported","request_id":"07ff7a59-4a17-94b6-99be-365b68c5b68f"}

MasterXue · 4 months ago
> 2.1.72 fix the bug, but I haven't verified it yet. I also noticed this fix, but I spent 3 hours researching version 2.1.72 and the issue still exists and has not been fixed @team-lead> code-review ⎿  API Error: 400 event:error data:{"code":"InvalidParameter","message":"model 'claude-opus-4-6' not found or not supported","request_id":"07ff7a59-4a17-94b6-99be-365b68c5b68f"}

Yes, I tested it and I'm sure it didn't fix it.
@team-lead❯
⎿  API Error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"Not supported model claude-opus-4-6"}}

it235 · 4 months ago
> > 2.1.72 fix the bug, but I haven't verified it yet. > > > I also noticed this fix, but I spent 3 hours researching version 2.1.72 and the issue still exists and has not been fixed > @team-lead> code-review ⎿  API Error: 400 event:error data:{"code":"InvalidParameter","message":"model 'claude-opus-4-6' not found or not supported","request_id":"07ff7a59-4a17-94b6-99be-365b68c5b68f"} Yes, I tested it and I'm sure it didn't fix it. @team-lead❯ ⎿  API Error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"Not supported model claude-opus-4-6"}}

I feel that this issue will not be fixed in the short term because unofficial sources are not taken seriously. I have searched through many issues but have not received any further updates. My boss is urging me why it is so simple that I cannot get through

MasterXue · 4 months ago
> > > 2.1.72 fix the bug, but I haven't verified it yet. > > > > > > I also noticed this fix, but I spent 3 hours researching version 2.1.72 and the issue still exists and has not been fixed > > @team-lead> code-review ⎿  API Error: 400 event:error data:{"code":"InvalidParameter","message":"model 'claude-opus-4-6' not found or not supported","request_id":"07ff7a59-4a17-94b6-99be-365b68c5b68f"} > > > Yes, I tested it and I'm sure it didn't fix it. @team-lead❯ ⎿  API Error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"Not supported model claude-opus-4-6"}} I feel that this issue will not be fixed in the short term because unofficial sources are not taken seriously. I have searched through many issues but have not received any further updates. My boss is urging me why it is so simple that I cannot get through

Why does the Changelog say the issue has been fixed? I think Agent Teams works great, but this bug has made it unusable.

MasterXue · 4 months ago

v2.1.74 maybe fix it, i tested it

East-rayyy · 4 months ago

@gavinyao — teammates defaulting to the wrong model ID is a known alias resolution issue. I built claude-alias-patch that fixes this by patching the model resolver and env var whitelist in cli.js.

It also lets you register custom model aliases via ANTHROPIC_DEFAULT_*_MODEL env vars, so if you're using a custom endpoint, your aliases map directly to the correct model IDs. Single install script — auto-patches your Claude instance.

gavinyao · 4 months ago
@gavinyao — teammates defaulting to the wrong model ID is a known alias resolution issue. I built claude-alias-patch that fixes this by patching the model resolver and env var whitelist in cli.js. It also lets you register custom model aliases via ANTHROPIC_DEFAULT_*_MODEL env vars, so if you're using a custom endpoint, your aliases map directly to the correct model IDs. Single install script — auto-patches your Claude instance.

good work!

freeformz · 3 months ago

getting 403's in my agent teams today with 2.1.85, but the main agent is fine, so afaict it's not a permission issue.

freeformz · 3 months ago

What seems to be happening is CC is picking the wrong arn, even though my ANTHROPIC_DEFAULT_OPUS_MODEL is set to the correct arn.

Example: My config says ...

"ANTHROPIC_DEFAULT_OPUS_MODEL": "arn:aws:bedrock:us-east-2:<id>:inference-profile/global.anthropic.claude-opus-4-6-v1",

but the error message says

arn:aws:bedrock:us-east-2:<id>:inference-profile/us.anthropic.claude-opus-4-6-v1
freeformz · 3 months ago

it also takes minutes to get the 403 errors.

Qingco · 3 months ago

PS E:\Claude Code> claude -v
2.1.112 (Claude Code)
仍然存在这个问题啊

freeformz · 1 month ago

This was solved for me by modelOverrides in settings.

tangwei-dev · 1 month ago
This was solved for me by modelOverrides in settings.

It works!