Plan from previous session auto-injected and executed in new session

Resolved 💬 4 comments Opened Mar 15, 2026 by zcunxin Closed Apr 14, 2026

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

  1. Enter Plan Mode, create a plan, then exit Plan Mode (ExitPlanMode)
  2. Complete the implementation (code written + committed)
  3. Start a new conversation/session
  4. 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.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗