Plan Mode: Auto-executing plans without user confirmation after context compaction
Description
When a conversation runs out of context and gets compacted/summarized, the system automatically injects "Implement the following plan:" followed by the plan content at the start of the new session. This causes the assistant to start executing the plan immediately without re-confirming with the user.
Steps to Reproduce
- Enter plan mode and create a detailed implementation plan
- User approves the plan using ExitPlanMode
- Context runs out during implementation, triggering automatic compaction
- New session starts with the summary
Observed Behavior
The new session receives a "user" message like:
{"type":"user","message":{"role":"user","content":"Implement the following plan:\n\n[plan content]..."}}
The assistant sees this as a user instruction and begins implementing immediately.
Expected Behavior
After context compaction, the assistant should:
- Inform the user that a plan exists from the previous session
- Ask for confirmation before continuing implementation
- Give the user the option to modify the plan or cancel
Impact
Users lose control over when implementation begins. They may not be ready to proceed, or may want to review/modify the plan before continuing.
Environment
- Claude Code CLI
- macOS
---
🤖 This issue was reported with assistance from Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗