Context limit reached during plan mode causes orphaned work and wasted tokens
Resolved 💬 3 comments Opened Feb 23, 2026 by Asclepius9 Closed Feb 27, 2026
Bug
When working in plan mode with a large conversation, Claude Code can hit the context limit mid-exploration. When this happens:
- Plan mode enters and spawns an Explore agent (27 tool uses, ~115k tokens)
- Explore agent completes successfully
- Claude reads files to continue planning
- Context limit reached — conversation becomes stuck
/compactfails with:Error: Conversation too long. Press esc twice to go up a few messages and try again./compactcontinues to fail on retry- The entire plan mode session (agent work + tokens) is orphaned and wasted
Expected Behavior
/compactshould be able to recover from context limit even in large conversations- Alternatively, Claude Code should proactively compact before hitting the hard limit, especially when in plan mode with active agent results
- Plan mode work (agent results, file reads) should not be silently lost
Impact
- ~115k tokens wasted on an Explore agent whose results were never usable
- User has to start a new conversation and redo the entire planning phase
- No way to recover — esc twice + /compact still fails
Environment
- Claude Code CLI
- Model: Claude Opus 4.6
- Large conversation with multiple prior tool uses before entering plan mode
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗