Plan from previous session auto-injected and executed in new session
Bug Description
When a Plan Mode session ends (ExitPlanMode), the plan content is persisted. Upon starting a new session, Claude Code automatically injects the previous plan as a prompt ("Implement the following plan: ...") and begins executing it — even if the implementation was already completed and committed in the previous session.
Steps to Reproduce
- Enter Plan Mode, create a plan, then exit Plan Mode (ExitPlanMode)
- Complete the implementation (code written + committed)
- Start a new conversation/session
- Claude Code automatically injects the old plan and starts executing it
Expected Behavior
A new session should not automatically resume or execute plans from a previous session without explicit user instruction.
Actual Behavior
The previous plan is injected as "Implement the following plan: [plan content]" at the start of the new session, and Claude Code proceeds to execute it autonomously.
Impact
Low severity (no destructive behavior observed — code already existed, no files were overwritten). However, it wastes tokens and could be dangerous if the plan involved destructive operations.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗