Agent Teams: Spawned teammates don't inherit model configuration from team lead
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
- Configure Claude Code to use a custom/internal model endpoint
- Enable Agent Teams experimental feature:
``json``
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
- Create a team:
````
TeamCreate with team_name: "test-team"
- Spawn teammates:
````
Agent with subagent_type: "general-purpose", team_name: "test-team"
- 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_notificationwithout 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:
- The
modelparameter passed to the Agent tool, OR - The team lead's current model configuration, OR
- 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).
17 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Hitting this too with custom endpoints. We've added a doctor check for this in Cozempic v0.9.0:
The check detects when
~/.claude/settings.jsonis missing amodelkey while team directories are present — since that's the condition where subagents silently fall back toclaude-opus-4-6instead 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.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.
https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2172
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.
v2.1.74 maybe fix it, i tested it
@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_*_MODELenv 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!
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.
What seems to be happening is CC is picking the wrong arn, even though my
ANTHROPIC_DEFAULT_OPUS_MODELis set to the correct arn.Example: My config says ...
but the error message says
it also takes minutes to get the 403 errors.
PS E:\Claude Code> claude -v
2.1.112 (Claude Code)
仍然存在这个问题啊
This was solved for me by modelOverrides in settings.
It works!