claude-code - 💡(How to fix) Fix [Feature Request] Support per-agent max_tokens configuration in frontmatter [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52516Fetched 2026-04-24 06:05:07
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1
RAW_BUFFERClick to expand / collapse

Bug Description I'm unable to specify a limited MAX_TOKENS for a team agent anymore since model: opus in the subagent frontmatter has now switched from the 200k to the 1M model. How do I limit the context of a specific subagent/teamagent without setting the global environment variable? I want the coordinator to have 200k and the team agents to have 1M context.

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.118
  • Feedback ID: 3db00a95-e39d-4033-87f2-1fc9b444f895

Errors

extent analysis

TL;DR

To limit the context of a specific subagent/teamagent without setting the global environment variable, consider using a configuration override or a model-specific setting.

Guidance

  • Review the documentation for the model: opus configuration to see if there's an option to specify a custom MAX_TOKENS limit for individual subagents or team agents.
  • Check if there's a way to configure the coordinator and team agents to use different models or settings, allowing for separate context limits.
  • Investigate if environment variables can be set on a per-subagent or per-teamagent basis, rather than globally.
  • Look into using a configuration file or override to specify custom settings for each subagent or team agent.

Notes

The issue lacks information about the specific configuration options available for the model: opus setting, so it's unclear what exact steps can be taken to resolve the issue.

Recommendation

Apply workaround: Use a configuration override or model-specific setting to limit the context of individual subagents or team agents, as this approach allows for more fine-grained control over the context limits without affecting the global environment variable.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Feature Request] Support per-agent max_tokens configuration in frontmatter [1 comments, 2 participants]