Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
area:agentsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive
Description
Bug Description
Team agent teammates (spawned via TeamCreate + Agent with team_name) inherit the leader's model ID (claude-opus-4-6) but NOT the [1m] context window variant. The leader runs on claude-opus-4-6[1m] (1M context), but spawned teammates resolve to claude-opus-4-6 (200k context).
This is distinct from #32368 (model ID inheritance, fixed in v2.1.72) — the model ID inherits correctly, but the context window modifier is stripped.
Steps to Reproduce
- Start Claude Code on Max plan —
/modelshows "Default (recommended) — Opus 4.6 with 1M context" selected - Configure
~/.claude/settings.json:
{
"model": "opus[1m]",
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
"CLAUDE_CODE_SUBAGENT_MODEL": "opus[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-6[1m]"
}
}- Create a team:
TeamCreate - Spawn a teammate:
Agentwithteam_nameparameter - In the teammate's pane, run
/model
Expected Behavior
Teammate's /model shows option 1: "Default (recommended) — Opus 4.6 with 1M context" ✔
Actual Behavior
Teammate's /model shows option 5: "Opus 4.6 — claude-opus-4-6" selected (200k, no 1M)
The teammate's system prompt confirms: "You are powered by the model named Opus 4.6. The exact model ID is claude-opus-4-6." — no [1m] suffix.
Notes
- Standalone subagents (no
team_name) DO correctly inheritopus[1m]viaCLAUDE_CODE_SUBAGENT_MODEL— their system prompt showsclaude-opus-4-6[1m] - Team teammates spawned via
TeamCreate+Agent(team_name=...)do NOT pick upCLAUDE_CODE_SUBAGENT_MODEL,model, orANTHROPIC_DEFAULT_OPUS_MODELfor the[1m]variant - The model ID itself inherits correctly (teammates get
claude-opus-4-6, not a different model) — only the[1m]context modifier is lost - v2.1.72 changelog says "Fixed team agents to inherit the leader's model" — this fixed the model ID but not the context window variant
Environment
- Claude Code: v2.1.80
- Plan: Claude Max
- OS: macOS (Darwin 25.3.0, M5 Max)
- Terminal: iTerm2 with tmux teammate mode
- Leader model:
claude-opus-4-6[1m](confirmed via/model→ option 1)
Related Issues
- Agent Teams: Spawned teammates don't inherit model configuration from team lead #32368 — Team agents model inheritance (fixed in v2.1.72, but
[1m]variant still stripped) - Task tool subagent spawning ignores model context window variant [1m] #29231 — Task tool subagent spawning ignores model context window variant
- [BUG] Cowork forces claude-opus-4-6[1m] (1M context) causing instant rate limit errors on Max plan #33154 — Cowork forces
claude-opus-4-6[1m]causing rate limits
Reacted by Park Dal, Clément Dumas and Samdish Suri
Metadata
Metadata
Assignees
Labels
area:agentsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive
Activity
anascleaning commentedon Mar 20, 2026
Additional Finding
After removing ALL model-related env vars and settings from
~/.claude/settings.json(nomodel, noCLAUDE_CODE_SUBAGENT_MODEL, noANTHROPIC_DEFAULT_OPUS_MODEL), Claude Code v2.1.80 still appends--model claude-opus-4-6to the teammate spawn command.The spawn command observed:
Manual test confirms the fix: when
--model claude-opus-4-6is manually removed from the spawn command, the teammate starts with Default (option 1 in/modelpicker = Opus 4.6 with 1M context on Max plan).Root cause: The teammate spawn logic reads the parent's resolved model ID but strips the
[1m]context window modifier before passing it via--model. The fix should either:[1m]suffix:--model claude-opus-4-6[1m]--modelentirely when the parent is on Default, letting the teammate inherit Default naturallyThis is not a configuration issue — no user-side settings can work around it.
Butanium commentedon Mar 25, 2026
Still experiencing this on v2.1.x — teammates spawn with 200k context even though the leader session runs opus[1m]. Would love to see this fixed!
🤖 Generated with Claude Code
anascleaning commentedon Mar 26, 2026
Workaround: CLI Source Patch (until officially fixed)
Since no user-side configuration can fix this (as noted above), I've been running a post-install CLI patch that intercepts the agent spawn points and appends
[1m]when the model isclaude-opus-4-6.Why env vars don't work
The parent session resolves the model ID before spawning the child process. So even with:
ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-6[1m]CLAUDE_CODE_SUBAGENT_MODEL=opus[1m]model: "opus[1m]"in settings.json...the parent still passes
--model claude-opus-4-6(no[1m]) to the teammate spawn command. The env vars help the parent session but don't propagate to child processes through the spawn path.The patch
Save as
~/bin/patch-claude-1m.shand run after everynpm install -g @anthropic-ai/claude-code:Caveats
npm install -g @anthropic-ai/claude-code).claude-opus-4-6[1m][1m](the model ID line). If you see plainclaude-opus-4-6, the patch didn't match.[1m]suffix (or omit--modelwhen parent is on Default).Impact
With the patch applied, agent teammates get 1M context — which is significant for complex multi-file tasks. Without it, teammates hit the 200K wall and lose context on large codebases.
@Butanium this should work for your setup too — adjust the CLI path for your platform.
jonleung commentedon Apr 5, 2026
Configuration workaround confirmed on v2.1.92 — no binary patching needed:
Teammates correctly get 1M context in tmux after this. Credit to @Reasonably (#34421) for discovering this approach. Full details and test matrix on #34421.
oconnorjoseph commentedon Apr 21, 2026
Running into the same
[1m]-stripping on team teammates on our end at BluMint. When our leader (runningclaude-opus-4-7[1m]) spawns a teammate viaAgent({team_name: ...}), the teammate's system prompt reportsclaude-opus-4-7with no[1m]suffix — confirmed via self-introspection in the spawned agent. The model ID inherits but the context-window modifier is lost, matching exactly what you observed on v2.1.80.This clusters with #45169, #51254, and #40929 around subagent model-config plumbing — different entry points (Agent tool, team spawn, subagent frontmatter, env var) all fail to preserve the
[1m]variant. Would very much appreciate a cohesive fix across the subagent spawn paths.kcarriedo commentedon May 17, 2026
This bites in a particularly nasty way because the symptom is silent — the teammate hits 200k, compacts, and the lead synthesizes the compacted result not realizing it was working with 1/5 the window it was supposed to have. The output looks fine until you cross-check what the teammate actually had access to.
A quick diagnostic if it's useful to the team triaging this: after spawning, ask the teammate to print
process.env.CLAUDE_MODEL(or whatever the effective model env var is in the teammate's process) — if the[1m]suffix is being stripped at spawn time vs. resolved later, this should show it directly without needing to trigger compaction.For people hitting this in the meantime: explicitly passing the model with the
[1m]suffix in theAgenttool call (rather than relying on inheritance) does propagate correctly in our testing. Ugly, but it's a reliable workaround until the inheritance path is fixed — you just have to remember to update every teammate-spawn site when you swap models.The deeper architectural question this raises: when a team lead's effective context budget differs from teammates', "synthesize results" becomes lossy in a way that's invisible to the user. Worth surfacing teammate context size in the team status output even after this is fixed, since the same asymmetry can show up via other paths (e.g. teammates spawned with
--modeloverrides).feat(SPEC-V3R5-CONSTITUTION-DUAL-001): W1 — Constitution Dual-Zone + …
github-actions commentedon Jun 17, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Aug 19, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.