Task tool subagent spawning ignores model context window variant [1m]

Resolved 💬 2 comments Opened Feb 27, 2026 by dionny Closed Mar 27, 2026

Bug Description

When spawning teammates/subagents via the Task tool, the [1m] context window variant of the model ID is stripped, resulting in subagents always running on the standard context window version.

Steps to Reproduce

  1. Set the model to claude-opus-4-6[1m] via any of:
  • CLAUDE_CODE_SUBAGENT_MODEL="claude-opus-4-6[1m]"
  • ANTHROPIC_MODEL="claude-opus-4-6[1m]"
  • Claude config file with explicit model setting
  1. Spawn a teammate via the Task tool
  2. Ask the teammate to report its model ID

Expected Behavior

The subagent should report running on claude-opus-4-6[1m] (1M context window variant).

Actual Behavior

The subagent reports running on claude-opus-4-6 (standard context window).

Observed behavior:

  • When model param is not specified on the Task tool (inherit from parent): the CLI passes --model claude-opus-4-6 — stripping the [1m] suffix
  • When model: "opus" is specified: the CLI passes --model opus — just the enum string, no context window variant

Neither path preserves the [1m] context window specifier regardless of environment variables or config file settings.

Expected Fix

The Task tool's subagent spawning should respect the full model ID including context window specifiers like [1m] from the parent session, environment variables, or config.

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6[1m]
  • Platform: macOS (Darwin 25.1.0)

View original on GitHub ↗

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