flâneur — a map of the web's best reading

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

Explore this link on the map →

saved by

related reading