[BUG] Plan mode stale file + default "clear context" exit creates silent work rollback risk
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Plan mode's stale plan file persistence combined with the default "clear context" exit option creates a chain of cascading failures that can silently destroy work. This goes beyond #18599 (default option concern) and #12505 (stale plan resurfacing) — the combination produces data loss scenarios that are difficult to diagnose.
This is the same class of problem as #10878 (VSCode: selection menus causing inadvertent confirmations), but occurring in the terminal.
Failure Chain
Setup: Session A creates a plan file. Work is completed (in the same session or separately). Session ends.
Session B begins:
- User starts a new session with a different task (e.g., "commit the completed work")
- User enters plan mode — CC finds the old plan file from Session A
- System prompt instructs CC to "build incrementally" on the existing plan
- CC presents the stale plan as if it's current work to be done
- User approves (default = "Yes, clear context and auto-accept edits")
- CC begins implementing the OLD plan, potentially rolling back completed work
- CC confidently reports "Done!" — user may not realize work has been reverted
The silent rollback risk is the most dangerous part. CC treats the stale plan as authoritative instructions and executes them with full confidence.
Compounding Issue: Enter Key Collision with IME Input
For users with IME input methods (Japanese, Chinese, Korean — any language that uses conversion), the failure chain is much easier to trigger accidentally:
- Plan mode exit prompt appears with the default "clear context" option highlighted
- User is typing in the input field (e.g., trying to type a message in Japanese)
- User presses Enter to confirm an IME character conversion
- Enter also approves the stale plan with the destructive default option
- Context is cleared, stale plan is approved
- The remaining text buffer (e.g., partial Japanese input) leaks into the new empty session as the first message
- CC has no context, responds to the garbled input
- User is now completely disoriented — old plan approved, context wiped, and no way to understand what just happened
This is not IME-specific — any user who presses Enter at the wrong moment can trigger it. But IME users press Enter far more frequently as part of normal typing (for character conversion), so the collision rate is significantly higher.
What Should Happen?
- Plan files should be scoped to sessions or automatically cleared/confirmed when a new session starts
- The default exit option should NOT be the most destructive one (see #18599)
- The approval prompt should be resilient to accidental Enter presses, especially when the user is actively typing
Impact
I have experienced this failure chain multiple times. Each time it resulted in:
- Significant confusion trying to understand what happened
- Risk of completed work being rolled back by CC implementing stale plans
- Complete loss of session context with no recovery path
Related Issues
- #18599 — Default plan mode exit option is destructive
- #12505 — Plan mode resurfaces old plans after session compaction
- #12838 — Plan mode persistence causes stale context to bleed across sessions (closed as duplicate)
- #10878 — VSCode: Selection menus causing inadvertent confirmations (same class of problem)
Steps to Reproduce
- Session A: Enter plan mode, create a plan, complete the work, end session
- Session B: Start new session with a different task
- Enter plan mode — observe that the old plan file is loaded
- Press Enter (or Shift+Tab) to approve with default option
- Observe: CC begins implementing the old, already-completed plan
- (IME variant): While the approval prompt is showing, type with an IME and press Enter for character conversion — observe unintended plan approval
Environment Info
- Platform: macOS (darwin)
- Terminal: Ghostty
- Input method: Japanese IME
- Workflow: Multiple sessions, sometimes with plan mode
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗