Skip to content

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

Description

@diegoesolorzano

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions