Cursor hooks
File-based agent loop hooks via `.cursor/hooks.json` — pre/post commands, governance gates. Use when enforcing policy without modifying agent prompts.From its SKILL.md
npx -y skills add HKTITAN/cursor-sdk --skill cursor-hooksAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.1 KB, 211 tokens by cl100k_base, as published. Nobody here has run it
cursor-hooks
Hooks are file-based, not programmatic. The SDK does not expose JS callbacks for the agent loop — use .cursor/hooks.json and rely on local.settingSources to load them.
When to use
- Lint / type-check gates before agent commits
- Audit logging or compliance commands after each turn
- Fail-fast policies that must run regardless of prompt
Concepts
- [[references/file-format]] —
.cursor/hooks.jsonshape - [[references/loading]] —
settingSourcesand project vs user vs team scope - [[references/programmatic-alternatives]] — what to use when you need JS callbacks (
onDelta,onStep)
Cross-links
local.settingSources→ [[../cursor-sdk/references/local-options]]- Stream-side observation → [[../cursor-runs/references/interaction-updates]]
- Sibling
.cursor/features → [[../cursor-rules/SKILL]] · [[../cursor-skills-system/SKILL]]
What ships with it: 3 files
1.7 KB alongside SKILL.md
references/
- file-format.md475 B
- loading.md516 B
- programmatic-alternatives.md783 B