From d90b7c52351f8232f10f835635524bfa742171f3 Mon Sep 17 00:00:00 2001 From: flex-yj-kim Date: Tue, 7 Jul 2026 16:15:08 +0900 Subject: [PATCH] fix(hook): echo tool_input as updatedInput so plan approval survives 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 #995 --- apps/hook/server/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/hook/server/index.ts b/apps/hook/server/index.ts index 53326ad78..9e5b6536e 100644 --- a/apps/hook/server/index.ts +++ b/apps/hook/server/index.ts @@ -1981,6 +1981,11 @@ if (args[0] === "sessions") { hookEventName: "PermissionRequest", decision: { behavior: "allow", + // Echo the original tool_input as updatedInput. Claude Code + // >= 2.1.199 silently drops an allow decision for ExitPlanMode + // (a tool requiring user interaction) when updatedInput is + // absent, falling back to the built-in approval dialog. + updatedInput: event.tool_input, ...(updatedPermissions.length > 0 && { updatedPermissions }), }, },