You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Subagent model resolution strips [1m] context window suffix #45169
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
Set "model": "opus[1m]" in ~/.claude/settings.json
Parent session correctly runs as claude-opus-4-6[1m] with 1M context
Spawn a subagent via the Agent tool (any type — custom agent, general-purpose, etc.)
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:
The simplest fix may be to omit the --model flag from the subagent spawn command when no explicit model override is specified (i.e., the agent should inherit the default).
Currently, the spawner resolves the model alias and passes it explicitly:
--model claude-opus-4-6 # [1m] stripped during resolution
If the --model flag were omitted entirely, the subagent process would read ~/.claude/settings.json on startup and resolve "model": "opus[1m]" naturally — the same way the parent session does. This would give subagents 1M context without any changes to the alias resolution logic.
When an explicit override IS specified (via Agent tool model parameter or agent frontmatter), the spawner should still pass --model but preserve the [1m] suffix through the resolution.
Additional findings — the [1m] suffix is actively stripped
Further testing confirms the spawner explicitly removes the [1m] suffix regardless of how the model is specified. This is not an alias resolution issue — it's deliberate suffix stripping.
Full test matrix
Frontmatter model value
Spawn --model flag
Result
(none — inherit from parent)
claude-opus-4-6
Opus, no 1M
opus[1m]
claude-opus-4-6
Opus, no 1M
default
claude-opus-4-6
Opus, no 1M
claude-opus-4-6[1m] (full ID)
claude-opus-4-6
Opus, no 1M
Key observation: spawner intercepts model values
When model: default is set in agent frontmatter, the spawn command still shows --model claude-opus-4-6 (Opus). But running the CLI directly with --model default resolves to Sonnet (platform default). This proves the spawner resolves model values before constructing the CLI command — the literal string never reaches --model.
Even when the full model ID claude-opus-4-6[1m] is specified in frontmatter, the spawner strips [1m] before passing it to --model. This points to explicit suffix-removal logic in the spawner, not a gap in alias resolution.
Where the fix needs to happen
The spawner's model resolution pipeline has a step that strips the [1m] context window suffix. This step needs to either:
Preserve the suffix through to the --model flag
Or omit --model entirely when no override is specified, letting the subprocess read settings.json
Seeing the identical stripping behavior on our team at BluMint — confirmed matches all three rows of your table. Parent runs claude-opus-4-7[1m], but spawned subagents (via Agent tool with model: "opus", via subagent frontmatter with model: claude-opus-4-7[1m], and with model: omitted entirely hoping for inheritance) all consistently resolve to the 200K variant.
This actively blocks our multi-agent orchestration workflows — research subagents investigating hypotheses over large codebases cannot fit the full context and compact mid-task, losing reasoning chains we care about. Same root cause as #51254 and #36670 from what we can tell.
Would very much appreciate preserving the [1m] suffix through model alias resolution in the subagent spawn path.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
github-actions commentedon Apr 8, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
dulvac commentedon Apr 8, 2026
Potential fix approach
The simplest fix may be to omit the
--modelflag from the subagent spawn command when no explicit model override is specified (i.e., the agent should inherit the default).Currently, the spawner resolves the model alias and passes it explicitly:
If the
--modelflag were omitted entirely, the subagent process would read~/.claude/settings.jsonon startup and resolve"model": "opus[1m]"naturally — the same way the parent session does. This would give subagents 1M context without any changes to the alias resolution logic.When an explicit override IS specified (via Agent tool
modelparameter or agent frontmatter), the spawner should still pass--modelbut preserve the[1m]suffix through the resolution.dulvac commentedon Apr 8, 2026
Additional findings — the
[1m]suffix is actively strippedFurther testing confirms the spawner explicitly removes the
[1m]suffix regardless of how the model is specified. This is not an alias resolution issue — it's deliberate suffix stripping.Full test matrix
modelvalue--modelflagclaude-opus-4-6opus[1m]claude-opus-4-6defaultclaude-opus-4-6claude-opus-4-6[1m](full ID)claude-opus-4-6Key observation: spawner intercepts model values
When
model: defaultis set in agent frontmatter, the spawn command still shows--model claude-opus-4-6(Opus). But running the CLI directly with--model defaultresolves to Sonnet (platform default). This proves the spawner resolves model values before constructing the CLI command — the literal string never reaches--model.Even when the full model ID
claude-opus-4-6[1m]is specified in frontmatter, the spawner strips[1m]before passing it to--model. This points to explicit suffix-removal logic in the spawner, not a gap in alias resolution.Where the fix needs to happen
The spawner's model resolution pipeline has a step that strips the
[1m]context window suffix. This step needs to either:--modelflag--modelentirely when no override is specified, letting the subprocess readsettings.jsonoconnorjoseph commentedon Apr 21, 2026
Seeing the identical stripping behavior on our team at BluMint — confirmed matches all three rows of your table. Parent runs
claude-opus-4-7[1m], but spawned subagents (via Agent tool withmodel: "opus", via subagent frontmatter withmodel: claude-opus-4-7[1m], and withmodel:omitted entirely hoping for inheritance) all consistently resolve to the 200K variant.This actively blocks our multi-agent orchestration workflows — research subagents investigating hypotheses over large codebases cannot fit the full context and compact mid-task, losing reasoning chains we care about. Same root cause as #51254 and #36670 from what we can tell.
Would very much appreciate preserving the
[1m]suffix through model alias resolution in the subagent spawn path.github-actions commentedon May 28, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Jul 26, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.