cursor-hooks
This repository provides ready-to-use examples and documentation for Cursor's Agent Hooks.
Install / Use
npx skills add hamzafer/cursor-hooksInstalls into whichever agent you are using.
.cursorrules
Cursor IDE rules (legacy)
Quality Score
Category
Content & MediaSupported Platforms
Our assessment of cursor-hooks
cursor-hooks scores 54/100 on our quality scale, 1143rd of 1,175 Content & Media skills we index.
Its .cursorrules is 2.2 KB long, split into 7 sections and no code examples: moderately detailed.
It has 29 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 13 months ago. Expect some instructions to reference tool versions or APIs that have since changed.
- Our last check on 2026-10-21 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 80/100, with 2 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
cursor-hooks compared with similar skills
All 4 of these similar skills score higher than cursor-hooks; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| cursor-hooks (this skill)by hamzafer | 54 | 29 | 13mo ago | .cursorrules |
| siyuanby siyuan-note | 100 | 47.1k | today | MCP Server |
| changelog-videoby heygen-com | 100 | 76.6k | 5d ago | SKILL.md |
| content-research-writerby ComposioHQ | 100 | 78.5k | 48d ago | SKILL.md |
| competitor-profilingby coreyhaines31 | 100 | 57.7k | 6d ago | SKILL.md |
Frequently asked questions
- How do I install cursor-hooks?
- Run
npx skills add hamzafer/cursor-hooks. The install tabs above show the steps for each supported agent. - Which AI agents does cursor-hooks work with?
- It is written for Cursor, as a .cursorrules file. Other agents that read the same format can often use it too.
- Is cursor-hooks safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 80/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is cursor-hooks still maintained?
- The repository was last updated about 13 months ago. Expect some instructions to reference tool versions or APIs that have since changed.
Skill content
View source on GitHubCursor Hooks Examples
This repo gives you copy‑paste ready recipes for Cursor's Agent Hooks. Hooks are lightweight scripts that exchange JSON with Cursor so you can observe, block, or mutate agent behavior.
Quickstart: Format Hook
Create a minimal hook that runs after every file edit. This repo already includes hooks.json and all referenced scripts under hooks/, so setup is just copying the files into ~/.cursor/.
- Copy
hooks.jsonto~/.cursor/hooks.json. - Copy every script from
hooks/to~/.cursor/hooks/. - Run
chmod +x ~/.cursor/hooks/*.shto make them executable. - Restart Cursor and verify the hook runs after edits. Tail
/tmp/agent-audit.logor/tmp/hooks.logto confirm activity.
Why Hooks Matter
With a handful of scripts you can:
- run formatters or linters immediately after Cursor edits a file
- audit or block shell commands before they execute
- redact secrets before the agent reads sensitive content
- apply safety guardrails around MCP tool usage
Each hook definition maps to an executable script. Cursor streams JSON input on stdin and expects JSON back on stdout, letting you tailor the agent loop without patching Cursor itself.
Hook Catalog
Everything you need to mirror the documentation examples lives in this repository:
hooks.jsonwires each documented hook event to the scripts inhooks/.hooks/format.shis the minimal formatter-style hook used in the Quickstart.hooks/audit.shcaptures every payload into/tmp/agent-audit.logfor auditing.hooks/block-git.shdenies raw git usage, requests approval forgh, and logs decisions to/tmp/hooks.log.hooks/redact-secrets.shprevents Cursor from reading files that look like they contain GitHub tokens.
How To Use This Repo
- Copy
hooks.jsonand the scripts inhooks/into~/.cursor/. - Run
chmod +x ~/.cursor/hooks/*.shso Cursor can execute them. - Tail
/tmp/hooks.logor/tmp/agent-audit.logto verify hook activity. - Restart Cursor after modifying any hook.
Contributing
Issues and pull requests are welcome. Please open an issue first if you plan to add new recipes or extend existing ones.
License
Released under the MIT License. See LICENSE.
Related Skills
siyuan
47.1kAn open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
changelog-video
76.6kTurn a weekly changelog .md into a finished branded changelog video (square 1080, ~45-60s, Annie VO, animated brand background, mock-UI visualizations, lowkey captions)
content-research-writer
78.5kAssists in writing high-quality content by conducting research, adding citations, improving hooks, iterating on outlines, and providing real-time feedback on each section. Transforms your writing process from solo effort to collaborative partnership.
competitor-profiling
57.7kWhen the user wants to research, profile, or analyze competitors from their URLs. Also use when the user mentions 'competitor profile,' 'competitor research,' 'competitor analysis,' 'profile this competitor,' 'analyze competitor,' 'competitive intelligence,' 'competitor deep dive,' 'who are my compe…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
