create-hook
SolidCreate Cursor hooks. Use to create a hook, write hooks.json, add hook scripts, or automate behavior around agent events.
Web & Frontend 9 stars
0 forks Updated yesterday MIT
Install
Quality Score: 82/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Creating Cursor Hooks
Create hooks when you want Cursor to run custom logic before or after agent events. Hooks are scripts or prompt-based checks that exchange JSON over stdin/stdout and can observe, block, modify, or follow up on behavior.
When the user asks for a hook, don't stop at describing the format. Gather the missing requirements, then create or update the hook files directly.
## Gather Requirements
Before you write anything, determine:
1. **Scope**: Should this be a project hook or a user hook?
2. **Trigger**: Which event should run the hook?
3. **Behavior**: Should it audit, deny/allow, rewrite input, inject context, or continue a workflow?
4. **Implementation**: Should it be a command hook (script) or a prompt hook?
5. **Filtering**: Does it need a matcher so it only runs for certain tools, commands, or subagent types?
6. **Safety**: Should failures fail open or fail closed?
Infer these from the conversation when possible. Only ask for the missing pieces.
## Choose the Right Location
- **Project hooks**: `.cursor/hooks.json` and `.cursor/hooks/*`
- **User hooks**: `~/.cursor/hooks.json` and `~/.cursor/hooks/*`
Path behavior matters:
- **Project hooks** run from the project root, so use paths like `.cursor/hooks/my-hook.sh`
- **User hooks** run from `~/.cursor/`, so use paths like `./hooks/my-hook.sh` or `hooks/my-hook.sh`
Prefer **project hooks** when the behavior should be shared with the repository and checked into version control.
## Choose the H...
Details
- Author
- kensaurus
- Repository
- kensaurus/cursor-kenji
- Created
- 7 months ago
- Last Updated
- yesterday
- Language
- JavaScript
- License
- MIT
Integrates with
Bundled in these plugins
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
create-hook
Create a hook (.json) to enforce policy or automate agent lifecycle events.
15 Updated 1 weeks ago
Pointa-Labs AI & Automation Listed
hooks-creator
Use when the user wants to customize Gemini CLI behavior using hooks (events, blockers, loggers).
1 Updated 3 days ago
MatrixFounder AI & Automation Listed
custom-hooks
Create project-specific hook scripts and register them in settings.json. Extends the framework's enforcement layer.
4 Updated 3 weeks ago
joris887