Subagent model resolution strips [1m] context window suffix

Resolved 💬 5 comments Opened Apr 8, 2026 by dulvac Closed May 28, 2026

Summary

When spawning subagents (via the Agent tool or agent teams), the [1m] context window suffix is stripped during model alias resolution. Subagents always get the default ~200k context window, even when the parent session runs with 1M context.

Reproduction

  1. Set "model": "opus[1m]" in ~/.claude/settings.json
  2. Parent session correctly runs as claude-opus-4-6[1m] with 1M context
  3. Spawn a subagent via the Agent tool (any type — custom agent, general-purpose, etc.)
  4. The subagent's system prompt shows claude-opus-4-6 (no [1m]) and no context window size is mentioned

Evidence

The subprocess command that spawns the subagent passes:

--model claude-opus-4-6

instead of:

--model claude-opus-4-6[1m]

What we tested

| Configuration | Result |
|---|---|
| Parent opus[1m], no agent override | Subagent gets claude-opus-4-6 (no 1M) |
| Agent frontmatter model: opus[1m] | Subagent gets claude-opus-4-6 (no 1M) |
| Agent tool model: "opus" | Subagent gets claude-opus-4-6 (no 1M) |

All three approaches produce the same result — the [1m] suffix is dropped.

Expected behavior

The model alias resolution should preserve the [1m] suffix:

opus[1m] → claude-opus-4-6[1m]   (expected)
opus[1m] → claude-opus-4-6        (actual)

Subagents should be able to inherit or be explicitly configured to use the 1M context window, through any of:

  • Inheriting from parent session's model setting
  • model: opus[1m] in agent definition frontmatter
  • model parameter on the Agent tool

Environment

  • Claude Code v2.1.96
  • macOS (Darwin 23.1.0)
  • Model: opus[1m] (parent), claude-opus-4-6 (subagents)

View original on GitHub ↗

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