VS Code extension: PreToolUse hook "ask" decisions are auto-approved without a prompt when auto-accept mode is on
Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Jul 30, 2026
Environment: Claude Code CLI 2.1.220, VS Code extension 2.1.220 (win32-x64), Windows 11.
A PreToolUse hook that returns:
{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "ask", "permissionDecisionReason": "..."}}
behaves differently per surface:
- Terminal CLI: "ask" forces a confirmation prompt even in auto-accept mode (verified 2026-07-23) — matching the documented intent of "ask".
- VS Code extension panel, auto mode: the tool call executes immediately with no prompt shown (verified 2026-07-29 with three different guard hooks — a destructive-command guard on
rm -r, an egress guard oncurl, and an edit-gating hook on the Edit tool). Each hook's ask JSON output was cross-checked by piping the identical stdin to the script locally, so the hooks did emit "ask". - For reference, Claude Desktop (manual mode) shows the prompt with the reason rendered in the dialog.
Expected: "ask" should force a user prompt regardless of permission mode, consistently across surfaces — that consistency is what makes hook-based safety guards trustworthy.
Impact: any safety hook relying on "ask" (destructive-command confirmation, data-egress confirmation, edit gating) is silently defeated for users driving Claude Code through the VS Code panel in auto mode. Only "deny" decisions remain effective on that surface.