Agent subprocesses always get 200K context instead of 1M — --model flag bypasses plan entitlement

Resolved 💬 14 comments Opened Mar 30, 2026 by ZainnQureshii Closed May 28, 2026

Description

When the orchestrator spawns agent subprocesses (teammates/subagents), Claude Code always passes --model claude-opus-4-6 to the subprocess command. This selects the explicit 200K Opus variant instead of the "Default (recommended)" option which is Opus 4.6 with 1M context.

The main/orchestrator session correctly gets 1M context through plan entitlement auto-detection (when no "model" is set in settings.json). But agent subprocesses never get a chance to auto-detect because --model is always injected.

Environment

  • Claude Code v2.1.87
  • Team plan with premium seat
  • macOS (Darwin)

Steps to Reproduce

  1. Remove "model": "opus" from .claude/settings.json (this fixes the main session — it correctly shows "Opus 4.6 (1M context)")
  2. Start a session with Agent Teams enabled (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1)
  3. Spawn any agent (teammate or subagent)
  4. Check the subprocess command — it always includes --model claude-opus-4-6
  5. Run /model inside the agent pane — it shows "Opus 4.6" (option 5) selected, NOT "Default (recommended)" (option 1, which has 1M context)

Subprocess Command

env CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 /Users/zain/.local/share/claude/versions/2.1.87 --agent-id alpha\@demo-team --agent-name alpha --team-name demo-team --agent-color blue --parent-session-id 938a1938-a6ed-4df4-a07e-998c7d04c520 --model claude-opus-4-6

Note: --model claude-opus-4-6 is the 200K variant. The 1M variant would be claude-opus-4-6[1m].

/model Menu Inside Agent Pane

1. Default (recommended)    Opus 4.6 with 1M context · Most capable for complex work
2. Sonnet                   Sonnet 4.6 · Best for everyday tasks
3. Sonnet (1M context)      Sonnet 4.6 with 1M context · Billed as extra usage
4. Haiku                    Haiku 4.5 · Fastest for quick answers
5. Opus 4.6 ✓               Newer version available · select Opus for Opus 4.6 (with 1M context)

Option 5 (200K) is selected instead of option 1 (1M).

Related: Settings.json Has the Same Bug (With Known Fix)

Setting "model": "opus" in .claude/settings.json also forces the main session to 200K. Removing the model key entirely fixes it — the main session then auto-detects the plan entitlement and gets 1M. This is documented in #34435.

The agent subprocess issue is the same root cause but has no workaround — Claude Code always injects --model claude-opus-4-6 regardless of whether the orchestrator passes a model parameter.

Expected Behavior

When no explicit model override is requested, agent subprocesses should either:

  • Not pass --model to the subprocess (let it use "Default" = Opus 4.6 with 1M)
  • Pass the 1M-aware model ID (claude-opus-4-6[1m]) when the parent session has 1M context

Workaround Attempted (Did Not Work)

  • Setting ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-6[1m] in settings.json env block — not passed through to subprocess
  • Omitting model parameter in Agent tool calls — Claude Code still injects --model claude-opus-4-6 into subprocess command
  • Removing model from agent definition frontmatter — same result

View original on GitHub ↗

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