-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Problem
In Claude Code, plan approval has multiple variants:
- Yes (Enter) — approve and continue
- 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 updatedPermissions → setMode 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:
- Sets the permission mode to
acceptEdits(already supported) - 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.