[FEATURE] Add "Compact and auto-accept edits" option to plan mode approval dialog
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
After completing plan mode, the approval dialog presents these options:
- Yes, clear context and auto-accept edits
- Yes, auto-accept edits
- Yes, manually approve edits
- Custom instructions
There is no option to compact the conversation context and then proceed with auto-accepted edits. Option 1 ("clear context") discards context entirely rather than summarizing it, which loses useful information. Option 2 preserves context but by the time a plan is finalized, the context window is often bloated with exploration artifacts (file reads, grep results, dead ends) that are no longer relevant to implementation.
Ideally I want to preserve a summary of the planning context (what was decided and why) while reclaiming token budget before implementation begins.
Proposed Solution
Add a new option to the plan approval dialog:
> Yes, compact and auto-accept edits
This would run compaction (equivalent to /compact) with the approved plan as compaction context, then proceed with auto-accept enabled. The plan file content should be preserved through compaction so that implementation can proceed without losing the agreed-upon steps.
Alternative Solutions
The current workaround is to approve with "Yes, auto-accept edits", then manually run /compact before Claude begins implementing. This works but is manual and easy to forget -- Claude often starts implementing immediately after approval, consuming context before you can intervene.
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- I enter plan mode to design a multi-file refactor
- Claude explores the codebase extensively (reading files, grepping, analyzing dependencies)
- Claude writes a plan and calls ExitPlanMode
- At this point the context window is 60-80% full with exploration artifacts
- I approve the plan with "Compact and auto-accept edits"
- Claude compacts the conversation, preserving the plan and key decisions but discarding raw file contents and intermediate search results
- Implementation proceeds with a clean context window and auto-accept enabled
Additional Context
Related issues: #18599 (change default plan mode exit option), #18978 (show context metrics at plan approval prompt).
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗