Plan mode state lost after context compression
Description
When using plan mode to design an implementation, approving the plan, and then executing (implementing) the plan, if the context window token limit is reached during the implementation phase, Claude Code prompts the user to re-enter plan mode instead of continuing with the implementation. This forces the user to restart the planning process even though the plan was already approved and implementation was in progress.
Steps to Reproduce
- Enter plan mode
- Design and finalize an implementation plan
- Approve the plan and begin implementation (exit plan mode → start coding)
- During implementation, reach the context window limit, triggering automatic context compression
- After compression, Claude Code prompts the user to re-enter plan mode instead of continuing the implementation
Expected Behavior
After context compression during the implementation phase, Claude should continue executing the approved plan — not prompt the user to re-enter plan mode. The implementation progress and approved plan should be preserved.
Actual Behavior
After context compression, Claude loses track of the fact that the plan was already approved and implementation was in progress. It prompts the user to re-enter plan mode, effectively restarting the workflow from scratch.
Suggested Improvement
- Persist the workflow state (plan approved → implementation in progress) as session-level metadata so it survives context compression
- Include the approved plan and current implementation progress in the compressed context summary
- At minimum, continue implementation rather than reverting to the planning phase
Environment
- Claude Code CLI
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗