Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support 'clear context + auto-accept edits' approval variant (shift+tab equivalent) #127

@jasonkuhrt

Description

@jasonkuhrt

Problem

In Claude Code, plan approval has multiple variants:

  1. Yes (Enter) — approve and continue
  2. Yes, clear context and auto-accept edits (Shift+Tab) — approve, compact/clear conversation context, and set permission mode to auto-accept edits

Plannotator currently supports permission mode switching (acceptEdits, bypassPermissions, default) via updatedPermissionssetMode in the hook response. This covers the "auto-accept edits" part. However, there is no mechanism to trigger conversation context clearing — the "clear context" half of the shift+tab behavior.

Current behavior

When a user approves a plan in the Plannotator UI, the hook outputs:

{
  "hookSpecificOutput": {
    "hookEventName": "PermissionRequest",
    "decision": {
      "behavior": "allow",
      "updatedPermissions": [{ "type": "setMode", "mode": "acceptEdits", "destination": "session" }]
    }
  }
}

This restores the permission mode but does not signal context clearing.

Desired behavior

Plannotator should offer an approval option equivalent to shift+tab — "Approve & clear context (auto-accept edits)" — that both:

  1. Sets the permission mode to acceptEdits (already supported)
  2. Triggers conversation context clearing/compaction

Open question

It's unclear whether Claude Code's hook response API currently supports a clearContext signal. If not, this may also require a feature request upstream to Claude Code's hook API to expose this capability. If the API does support it already (or gains support), Plannotator could add it as a checkbox or button variant in the approve UI.

Context

The shift+tab approval variant is valuable for long planning conversations where the plan itself captures all needed context — clearing the conversation before implementation reduces noise and token usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions