ExitPlanMode rejection/interruption causes session restart, losing all context
Bug Description
When ExitPlanMode is rejected or interrupted by the user, the Claude Code CLI terminates the current session and spawns a new one with just the plan text as the initial prompt. All accumulated in-session context (skill-injected preferences, exploration results, etc.) is lost.
Steps to Reproduce
- Start a new Claude Code session
- Invoke a skill (e.g.,
some-skill) that loads additional context/preferences into the session - Enter plan mode and go through codebase exploration
- Approve the plan —
ExitPlanModeis called - If
ExitPlanModeneeds to be called multiple times (e.g., plan revisions), reject/interrupt one of the calls
Expected Behavior
The session should continue in-place after ExitPlanMode rejection. The user should be able to provide feedback and the assistant should retry within the same session, preserving all context.
Actual Behavior
The CLI terminates the old session and starts a new session with only the plan text injected as the initial prompt. Evidence from session transcripts:
- Old session (session A): Ends with
ExitPlanModetool call, followed by atool_resultwithis_error: trueand message:"The user doesn't want to proceed with this tool use. The tool use was rejected" - New session (session B): Starts with
"[Request interrupted by user for tool use]"followed by"Implement the following plan: ..."containing only the plan text
All context from skills, codebase exploration, and user preferences loaded during the old session was lost.
Impact
- Skill-injected context (from custom skills) is completely lost
- Codebase exploration done during planning must be redone
- User preferences loaded via skills are not applied during execution
- The plan itself includes a transcript file path hint as a workaround, but the assistant may not read it
Environment
- Claude Code version: 2.1.34
- Model: claude-opus-4-6
- Platform: macOS (Darwin 25.2.0)
- Session type: Local terminal (not remote)
Additional Context
The ExitPlanMode tool was called 4 times in the old session (due to plan revisions requested by the user). The final call was rejected, triggering the session restart. The plan file was written to ~/.claude/plans/xyz.md and the new session received its content, but none of the conversational context survived.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗