[BUG] Agent Teams teammates lose [1m] context window suffix — root cause: tmux spawn hardcodes model without variant
Preflight Checklist
- [x] I have searched existing issues and found related closed issues (#24429, #27038, #27261) but they were closed as NOT_PLANNED without addressing this specific root cause
- [x] I can reproduce this on the latest version of Claude Code
Bug Description
When spawning Agent Teams teammates, the [1m] context window variant suffix is stripped from the --model argument passed to the tmux pane process. This silently downgrades teammates from 1M to 200K context window.
Root Cause (verified via ps -eo pid,args)
The parent session runs as claude-opus-4-6[1m], but when spawning a teammate via tmux, the CLI constructs the command as:
/Users/.../.local/share/claude/versions/2.1.76 \
--agent-id inspect-me@test-team-9 \
--agent-name inspect-me \
--team-name test-team-9 \
--agent-color blue \
--parent-session-id 192a86de-... \
--model claude-opus-4-6 ← [1m] suffix stripped
The --model value is claude-opus-4-6 instead of claude-opus-4-6[1m]. The variant suffix is lost during model resolution before the tmux command is constructed.
Reproduction
# Parent session: claude-opus-4-6[1m]
# Test 1: Subagent (inherits [1m] correctly)
Agent(prompt="Report your model ID")
→ "claude-opus-4-6[1m]" ✅
# Test 2: Teammate (loses [1m])
TeamCreate(team_name="test")
Agent(team_name="test", name="t1", prompt="Report your model ID")
→ "claude-opus-4-6" ❌ (200K instead of 1M)
# Test 3: Subagent spawned FROM a teammate (inherits [1m])
# (teammate spawns Agent() without team_name)
→ "claude-opus-4-6[1m]" ✅
Test 3 is particularly interesting — subagents always inherit [1m] regardless of where they're spawned from, but the teammate itself never gets it.
Impact
- Silent 5x context reduction: Teammates intended for large codebase analysis (research, architecture review, module exploration) are silently limited to 200K instead of 1M
- No workaround: The
modelparameter enum only accepts"sonnet" | "opus" | "haiku"— cannot pass"opus[1m]". Settingmodel: "opus[1m]"in settings.json also does not propagate to teammates - Cost without benefit: Users paying for 1M context don't get it on teammates
Suggested Fix
In the teammate spawn path (tmux/iTerm2 backend), preserve the full model string including variant suffix when constructing the --model argument:
- --model claude-opus-4-6
+ --model claude-opus-4-6[1m]
Or better: if no explicit model override is specified for the teammate, don't pass --model at all and let it inherit from the session default (same as subagents do).
Environment
- Claude Code version: 2.1.76
- OS: macOS Darwin 24.6.0
- Model: claude-opus-4-6[1m]
- Teammate backend: tmux (pane-based)
Related Issues
- #24429 — Root issue for model parameter ignored (closed NOT_PLANNED)
- #27038 — Detailed source analysis of the bug
- #27261 — Duplicate focusing on [1m] inheritance
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗