Most hooks are shell scripts, but some decisions require judgment. That's where type: prompt and type: agent hooks come in.
A prompt hook sends the tool input to a single LLM call. The model returns {"ok": true} to allow or {"ok": false, "reason": "..."} to block. Use this when the right answer depends on context that a regex can't capture.
A type: agent hook runs a full subagent with access to tools. The agent can read files, run searches, and reason across multiple steps before returning its verdict, with a -second timeout.
Both types return {"ok": true} to allow, or {"ok": false, "reason": "..."} to block. The reason goes to Claude as feedback when the hook blocks.