Plan mode state lost after context compression

Resolved 💬 2 comments Opened Feb 16, 2026 by youngho-dev Closed Feb 16, 2026

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

  1. Enter plan mode
  2. Design and finalize an implementation plan
  3. Approve the plan and begin implementation (exit plan mode → start coding)
  4. During implementation, reach the context window limit, triggering automatic context compression
  5. 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

View original on GitHub ↗

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