Add 'compact context' option when accepting plans in Plan Mode

Resolved 💬 5 comments Opened Mar 24, 2026 by diegoesolorzano Closed May 24, 2026

Problem

When accepting a plan in Plan Mode, the only context management option available is "clear context" (enabled via showClearContextOnPlanAccept). This is a binary choice: either keep the full context (with all exploration cruft) or wipe it entirely.

Clearing context loses valuable information — decisions made during exploration, constraints discovered, instructions from skills/workflows, and reasoning that informed the plan. Keeping everything wastes context window on verbose tool outputs and dead-end explorations.

Proposed Solution

Add a "compact context and implement" option to the plan acceptance prompt, alongside the existing clear/keep options. This would run the equivalent of /compact before transitioning to execution mode.

Compaction preserves the important parts (decisions, constraints, plan rationale) while removing noise (verbose tool outputs, exploration tangents, failed attempts). This gives the execution phase a clean but informed context window.

Possible implementations

  1. New option in the plan accept prompt: "Yes, compact context and implement" as a third choice
  2. New setting: compactOnPlanAccept: true (similar to showClearContextOnPlanAccept)
  3. New hook event: PlanAccept — would let users configure any behavior at the plan→execution transition, including but not limited to compaction

Option 3 is the most flexible and consistent with the existing hooks architecture.

Current Workaround

Accept plan → manually run /compact → Claude resumes execution. Works, but adds friction to every plan cycle.

Related Issues

  • #19326 — Original request for compact option in plan mode
  • #25734 — Discussion about clear context being destructive as default
  • #18878 — Configuring/disabling clear context default

View original on GitHub ↗

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