I’m trying to use a Stop hook in Cursor with type: “prompt”, but I’m not sure whether my configuration is incorrect or whether this is currently not supported.
Known bug: hooks may not load when only a stop hook is defined
There’s a known issue where hooks don’t load if your config only has a stop hook and nothing else. That could explain the empty output and exit code 2. The hook might not even be starting.
As a workaround, try adding a minimal no-op hook for another event alongside your stop hook:
{
"version": 1,
"hooks": {
"afterFileEdit": [
{
"command": "cat > /dev/null"
}
],
"stop": [
{
"type": "prompt",
"prompt": "Review whether the agent completed the task fully. Return ok: true if complete, ok: false with a reason if something is missing.",
"timeout": 60
}
]
}
}
Your prompt always forces ok: false
Prompt-type hooks act like a gate. The LLM returns { ok: boolean, reason?: string }. If ok: false, Cursor treats it as a deny (exit code 2). Your prompt tells the model to output {"ok": false, ...}, so even when the hook runs, it’ll always deny.
The prompt should describe a condition for the LLM to check, not hardcode the result. Let the model decide ok: true or ok: false.
Also worth noting, for the stop event the agent is already done. A deny result won’t undo completed work. It’s mainly useful for observation or logging.
Can you share your Cursor version and OS? Also let me know if adding the extra hook changes anything.