Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
With failClosed: true on a user PreToolUse hook, concurrent Agent tool calls intermittently return exit code 0 with empty stdout. Cursor then reports the hook “returned no output” and blocks the tool (e.g. Read/Write). The same hook command invoked outside Cursor with piped stdin (including 20 parallel jobs) always returns {“permission”:“allow”}. This is not a policy deny.
Steps to Reproduce
- Configure a single user PreToolUse hook in ~/.cursor/hooks.json with failClosed: true, e.g.
command: C:/Users//AppData/Roaming/npm/cc-safety-net.cmd hook --cursor
timeout: 30
failClosed: true - In Agent chat, issue two tool calls in one turn (e.g. parallel Read of two different files).
- Observe: one call succeeds; the other is blocked with “hook … returned no output”.
- Check Output → Hooks (or %APPDATA%\Cursor\logs...\cursor.hooks.workspaceId-*.log): the failing call shows exit code 0 and OUTPUT: (empty) after ~1–2s (not a timeout).
Expected Behavior
Each PreToolUse invocation should receive the hook process’s JSON on stdout (or a real non-zero exit / deny). Concurrent tool calls should not drop stdout while still reporting exit code 0.
Operating System
Windows 10/11
Version Information
3.24.10
For AI issues: add Request ID with privacy disabled
N/A — Privacy Mode enabled (Request ID not useful without Share Data)
Additional Information
Privacy Mode is enabled, so a Request ID is not useful for backend lookup.
Evidence is local Hooks channel / on-disk log (2026-10-09T13:55:28Z):
Parallel Reads ~0.6s apart:
- Read .cursor/BUGBOT.md → Command exit code 0 (1328ms), OUTPUT: (empty), “Hook 1 produced no output”
- Read .github/copilot-instructions.md → exit code 0 (1161ms), OUTPUT: {“permission”:“allow”}
Same pattern repeated at 13:55:59Z. Solo Write of the same path shortly after succeeded.
Control: outside Cursor, 20 concurrent invocations of the identical .cmd with JSON on stdin → 0/20 empty.
Note: managed npx -y cc-safety-net hook --cursor was abandoned earlier because npm can prepend warnings to stdout and break JSON parse; absolute .cmd was intentional.
On-disk Hooks log path pattern:
%APPDATA%\Cursor\logs<session>\window*wb*\output\cursor.hooks.workspaceId-.log
Does this stop you from using Cursor
No - Cursor works, but with this issue