Hooks | Cursor Docs
cursor.com · 5,887 words · saved by 1 readers
Built-in hooks and how to use them effectively in Cursor.
# Hooks Hooks let you observe, control, and extend the agent loop using custom scripts. Hooks are spawned processes that communicate over stdio using JSON in both directions. They run before or after defined stages of the agent loop and can observe, block, or modify behavior. [Media](/docs-static/images/agent/hooks.mp4) With hooks, you can: - Run formatters after edits - Add analytics for events - Scan for PII or secrets - Gate risky operations (e.g., SQL writes) - Control subagent (Task tool) execution - Inject context at session start Looking for ready-to-use integrations? See [Partner Integ
saved by
related reading
- Best practices for coding with agents · Cursorcursor.com
- goose | Your open source AI agentblock.github.io
- Cursor: AI coding agentcursor.sh
- Cursor: AI coding agentcursor.com
- Cursor: AI coding agentcursor.com
- Agent Skills | Cursor Docscursor.com
- Subagents | Cursor Docscursor.com
- Dynamic context discovery · Cursorcursor.com
- Towards self-driving codebases · Cursorcursor.com
- GitHub - PatrickJS/awesome-cursorrules: 📄 Configuration files that enhance Cursor AI editor experience with custom rules and behaviorsgithub.com
- Continually improving our agent harness · Cursorcursor.com
- Scaling long-running autonomous coding · Cursorcursor.com