Hook Handler Has Type
Each hook handler object in .cursor/hooks.json MUST contain a "type" field set to command or prompt. Without a type field, Cursor cannot dispatch the handler and the hook silently does nothing.
Antipatterns
- Missing type field. Defining a handler with only
"command"but no"type"key. - Invalid type value. Setting
"type": "shell"or"type": "script"instead ofcommandorprompt.
Pass / Fail
Pass
{
"hooks": {
"sessionStart": [
{ "type": "command", "command": "echo hook" }
]
}
}
Fail
{
"hooks": {
"sessionStart": [
{ "command": "echo hook" }
]
}
}
Limitations
Checks that at least one handler has a valid type field. Does not verify every handler individually.
