[BUG] Team agent teammates don't inherit [1m] context window variant from leader (v2.1.80)

Resolved 💬 7 comments Opened Mar 20, 2026 by anascleaning Closed Jun 17, 2026

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

  1. Start Claude Code on Max plan — /model shows "Default (recommended) — Opus 4.6 with 1M context" selected
  2. 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]"
  }
}
  1. Create a team: TeamCreate
  2. Spawn a teammate: Agent with team_name parameter
  3. 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 inherit opus[1m] via CLAUDE_CODE_SUBAGENT_MODEL — their system prompt shows claude-opus-4-6[1m]
  • Team teammates spawned via TeamCreate + Agent(team_name=...) do NOT pick up CLAUDE_CODE_SUBAGENT_MODEL, model, or ANTHROPIC_DEFAULT_OPUS_MODEL for 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

  • #32368 — Team agents model inheritance (fixed in v2.1.72, but [1m] variant still stripped)
  • #29231 — Task tool subagent spawning ignores model context window variant
  • #33154 — Cowork forces claude-opus-4-6[1m] causing rate limits

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗