Hooks: "ask" permission broken in 2.4.21

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When a beforeShellExecution hook returns permission: "ask", the command executes immediately without prompting the user for approval.

The allow and deny permissions work correctly - only ask is broken.

Permission Expected Actual Status
"allow" Command runs Command runs :white_check_mark: Works
"deny" Command blocked Command blocked :white_check_mark: Works
"ask" User prompted Command runs (no prompt) :cross_mark: Broken

Environment:

  • Platform: Linux (Remote SSH)
  • Broken Version: 2.4.21
  • Working Version: 2.1.50 (regression)

The Hooks panel in Cursor Settings shows the hook correctly returned “ASK” (see attached screenshot), confirming Cursor receives the response but ignores it.

Steps to Reproduce

  1. Create .cursor/hooks.json:
{
  "version": 1,
  "hooks": {
    "beforeShellExecution": [
      {"command": "python3 .cursor/test_hook.py"}
    ]
  }
}
  1. Create .cursor/test_hook.py:
import json
import sys

payload = json.load(sys.stdin)
cmd = payload.get("command", "")

if cmd.startswith("rm"):
    print(json.dumps({
        "permission": "ask",
        "user_message": "Dangerous command needs approval",
        "agent_message": "Please approve this rm command"
    }))
else:
    print(json.dumps({"permission": "allow"}))
  1. Reload Cursor window
  2. Have the agent execute: rm /tmp/testfile.txt

Expected Behavior

When the hook returns permission: "ask", Cursor should display a prompt allowing the user to approve or deny the command before it runs.

Actual behavior: The command runs immediately without any user prompt.

Note: Changing "ask" to "deny" correctly blocks the command, confirming the hook is working - only the "ask" permission is broken.

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 2.4.21 (Universal)
VSCode Version: 1.105.1
Commit: dc8361355d709f306d5159635a677a571b277bc0
Date: 2026-01-22T16:57:59.675Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin x64 24.6.0

For AI issues: which model did you use?

Claude-4.5-opus-high

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This is a known issue, the exact same bug was already reported here: Hook ASK output not stopping agent

The regression happened somewhere between 2.2 and 2.3. The team is aware and the bug is logged. It affects both the beforeShellExecution and beforeMcpCall hooks. Allow and deny work, only ask is broken.

For now, the workaround is to use deny instead of ask for critical operations. You won’t get a user prompt, but at least it blocks execution. I’ll post here if there are any updates.