showClearContextOnPlanAccept is not honored when plan is approved via a PermissionRequest hook
When a PermissionRequest hook on ExitPlanMode returns behavior: "allow", it bypasses the native plan-approval dialog entirely. showClearContextOnPlanAccept: true has no effect on this path because the clear-context option only exists inside that dialog.
This was partially described in #25690 (now closed/locked as stale), which noted: _"PermissionRequest hook can auto-approve, but always uses 'keep context' behavior."_ This issue focuses specifically on the showClearContextOnPlanAccept setting being silently ignored on the hook path.
Steps to reproduce
- Set
"showClearContextOnPlanAccept": truein~/.claude/settings.json. - Install a plugin that handles plan approval via a
PermissionRequest/ExitPlanModehook (e.g. plannotator). - Enter plan mode and approve via the plugin's UI.
- Observe: Claude proceeds with full accumulated context — the clear-context prompt never appears.
Expected behavior
When showClearContextOnPlanAccept is true, a plan approval that goes through the hook path should either:
- consult the setting and clear context before handing off to the agent, or
- expose a
clearContextfield in the hook decision schema so the hook can opt in explicitly.
Actual behavior
The hook-allow path ignores showClearContextOnPlanAccept entirely. The user's configured preference is silently dropped.
Proposed fix
Option A (honor the setting automatically): when showClearContextOnPlanAccept: true and a PermissionRequest/ExitPlanMode hook returns behavior: "allow", clear the planning context before resuming — consistent with what a manual approval would have done.
Option B (expose a schema field): add an optional clearContext: boolean to the PermissionRequest decision object so hooks can signal this explicitly. Plugins like plannotator can then surface an "Approve + clear context" button and set the field accordingly.
Option A requires no plugin changes and is the path of least resistance for users who already have the setting on. Option B gives plugins explicit control.
Related: #25690 (closed/locked), #38472
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗