claude-code - 💡(How to fix) Fix [Bug] Plan mode subagents report context limit exceeded on first prompt from main agent [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#54651Fetched 2026-04-30 06:39:49
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×5commented ×1

Error Message

Plan mode appears to be hitting the context limit immediately when the main agent delegates tasks to subagents. Each subagent returns a Context limit reached · /compact or /clear to continue error on the first prompt, before doing any work.

RAW_BUFFERClick to expand / collapse

Bug Description

Plan mode appears to be hitting the context limit immediately when the main agent delegates tasks to subagents. Each subagent returns a Context limit reached · /compact or /clear to continue error on the first prompt, before doing any work.

This happens immediately on the first prompt, so it seems like the subagents are starting with an already-full context or inheriting too much context from the main agent.

Environment Info

  • Platform: darwin
  • Terminal: VS Code
  • Version: 2.1.123
  • Feedback ID: 31334783-b33a-4d83-b11f-934e6c6dd9cb

extent analysis

TL;DR

The subagents may be inheriting too much context from the main agent, causing them to hit the context limit immediately.

Guidance

  • Verify that the subagents are not inheriting unnecessary context from the main agent by checking the context size before and after delegation.
  • Consider using the /compact or /clear commands to reduce the context size before delegating tasks to subagents.
  • Investigate if there are any configuration options to control the amount of context inherited by subagents.
  • Check if there are any known issues or limitations in Version 2.1.123 related to context limits and subagents.

Notes

The exact cause of the issue is unclear, and more information about the configuration and implementation of the subagents and main agent may be needed to provide a definitive solution.

Recommendation

Apply workaround: Use the /compact or /clear commands to reduce the context size before delegating tasks to subagents, as this may help mitigate the issue until a more permanent solution is found.

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 [Bug] Plan mode subagents report context limit exceeded on first prompt from main agent [1 comments, 2 participants]