# Cursor Hooks Hooks in [[Cursor.com|Cursor]] are custom scripts that observe, control, and extend the agent loop. You configure them in a `.cursor/hooks.json` file, and they run at defined points while an agent works. In practice you use them to audit what the agent did, or to block an unsafe action before it runs. Hooks behave the same way across local, cloud, and self-hosted agents. ## Hook events - **beforeSubmitPrompt** — fires before a prompt is sent, and can modify it - **PreToolUse** — fires before the agent runs a tool, and can block or alter the call - **PostToolUse** — fires after a tool runs - **stop** — fires when the agent finishes a turn ## Notes - Hooks enforce policy that [[Cursor Rules]] cannot. Rules shape behavior; hooks can hard-block it. - A January 2026 update made hook commands start roughly 40x faster, which removed the main reason to avoid them. - [[Cursor Skills]] can bundle their own hooks, so a skill ships with its own guardrails. ## References - Hooks documentation: https://cursor.com/docs/hooks - Changelog: https://cursor.com/changelog ## Related - [[Cursor.com]] - [[Cursor Rules]] - [[Cursor Skills]] - [[Cursor Agent Mode]] - [[Claude Code Hooks]] - [[AI Agents]]