Skip to content

fix(hook): echo tool_input as updatedInput so plan approval survives Claude Code 2.1.199+#1008

Open
flex-yj-kim wants to merge 1 commit into
backnotprop:mainfrom
flex-yj-kim:upstream-pr/exitplanmode-approve-updatedinput
Open

fix(hook): echo tool_input as updatedInput so plan approval survives Claude Code 2.1.199+#1008
flex-yj-kim wants to merge 1 commit into
backnotprop:mainfrom
flex-yj-kim:upstream-pr/exitplanmode-approve-updatedinput

Conversation

@flex-yj-kim

Copy link
Copy Markdown
Contributor

Problem

Since Claude Code 2.1.199, clicking Approve in the plan review UI no longer returns control to the CLI — the page closes but the built-in plan-approval dialog reappears in the terminal. Deny is unaffected. Reproduced on 2.1.199–2.1.202.

Cause

2.1.199 added a guard that discards a PermissionRequest allow for ExitPlanMode when updatedInput is absent (ExitPlanMode requires user interaction and isn't an MCP tool). The hook emitted a bare allow, so it was dropped — along with updatedPermissions. The deny path skips this guard, matching the symptom.

Fix

Echo the original tool_input (in scope as event.tool_input) back as decision.updatedInput. Backward compatible — a verified no-op on 2.1.198, so safe to ship unconditionally.

Verification

Built the hook binary with this change, ran it against a mock ExitPlanMode event, and drove /api/approve; the decision now carries updatedInput plus updatedPermissions. Independently confirmed on 2.1.201 in #995 and anthropics/claude-code#74256.

Fixes #995

…Claude Code 2.1.199+

Since Claude Code 2.1.199, a PermissionRequest "allow" decision for
ExitPlanMode is silently discarded unless it echoes updatedInput, because
ExitPlanMode requires user interaction and is not an MCP tool. The CLI then
falls back to its built-in approval dialog, so clicking Approve in the
Plannotator UI never returned control to the agent session (deny was
unaffected). This matches the reported behavior on 2.1.199 through 2.1.202.

Echo the original tool_input (in scope as event.tool_input) as updatedInput
in the Claude Code allow decision. Backward compatible: older Claude Code
versions treat the echoed input as unchanged (verified no-op on 2.1.198).

Fixes backnotprop#995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan Approve silently ignored on Claude Code >= 2.1.200: PermissionRequest allow without updatedInput is discarded for ExitPlanMode

1 participant