What problem does it solve?
Creates or adds Cursor agent lifecycle hooks. Use when the user asks to create a hook, add a hook, set up a lifecycle hook, or automate something on agent stop, afterFileEdit, afterAgentResponse, or other Cursor hook events. Hooks live in .cursor/hooks/ and are registered in .cursor/hooks.json.
Core Features & Use Cases
- Automates the setup of Cursor lifecycle hooks by providing a standard workflow for defining a hook script, its location, and its event registration.
- Supports events like stop, afterFileEdit, afterAgentResponse, beforeSubmitPrompt, and other Cursor hook events, enabling automation and lifecycle customization for agents.
- Keeps hooks at project scope (in .cursor/hooks/ and .cursor/hooks.json) for consistent, shareable behavior across agents and runs.
- Use Case: When a user asks to create a hook that logs or enforces behavior at agent stop, or to run cleanup steps after file edits.
Quick Start
Create a new Node.js or shell script in .cursor/hooks/ for the desired hook behavior, then add an entry to .cursor/hooks.json to register the hook for the appropriate event.