Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/kensaurus/cursor-kenji/create-hooknpx skills add kensaurus/cursor-kenji --skill create-hookgit clone --depth 1 https://github.com/kensaurus/cursor-kenjiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kensaurus/cursor-kenji/create-hook)<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/create-hook"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/create-hook.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00028 | $0.02178 |
| Opus 5 | $0.00014 | $0.01089 |
| Sonnet 5 | $0.00006 | $0.00436 |
| Haiku 4.5 | $0.00003 | $0.00218 |
Grade A, and why
create-hook scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
"matcher": "curl|wget|nc ", This is a copy
94% identical to create-hook — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 239 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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:
- Scope: Should this be a project hook or a user hook?
- Trigger: Which event should run the hook?
- Behavior: Should it audit, deny/allow, rewrite input, inject context, or continue a workflow?
- Implementation: Should it be a command hook (script) or a prompt hook?
- Filtering: Does it need a matcher so it only runs for certain tools, commands, or subagent types?
- 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.jsonand.cursor/hooks/* - User hooks:
~/.cursor/hooks.jsonand~/.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.shorhooks/my-hook.sh
Prefer project hooks when the behavior should be shared with the repository and checked into version control.
Choose the Hook Event
Use the narrowest event that matches the user's goal.
Common Agent events
sessionStart,sessionEnd: set up or audit a sessionpreToolUse,postToolUse,postToolUseFailure: work across all toolssubagentStart,subagentStop: control or continue Task/subagent workflowsbeforeShellExecution,afterShellExecution: gate or audit terminal commandsbeforeMCPExecution,afterMCPExecution: gate or audit MCP tool callsbeforeReadFile,afterFileEdit: control file reads or post-process editsbeforeSubmitPrompt: validate prompts before they are sentpreCompact: observe context compactionstop: handle agent completionafterAgentResponse,afterAgentThought: track agent output or reasoning
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 239 lines · 28 tokens per session scan A be87104bbf49
create-hook is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 7d ago), licensed MIT. It adds 28 tokens to every session and 2,178 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 94% identical to create-hook, differing in 5 lines, and is treated as a copy.
Other skills, from other repositories
comprehensive-enrichment
Enrich any person or company from any identifier — email, name, LinkedIn URL, domain, company name, Twitter/X handle. Use when asked to enrich, look up, or research a lead, contact, person, or company.
paid-channel-prioritizer
For founders who don't know where to start with paid ads. Analyzes ICP, competitor ad presence, budget constraints, and product type to recommend which 1-2 paid channels to start with and provides a 90-day ramp plan. Prevents the common mistake of spreading a small budget across too many platforms.
data-charts-tako
Search and visualize the world's data - get charts, insights, and embeddable knowledge cards for finance, economics, demographics, sports, and more.
lead-discovery
Orchestrator that runs first for lead generation requests. Gathers business context via website analysis or questions, identifies competitors, builds ICP, and routes to signal skills with pre-filled inputs.
render-cosmic-mythology-voiceover
Assemble a cosmic-mythology-voiceover reel from a config — a warm spoken voiceover carries the whole narrative while N curated cosmic stills are weighted beat-synced across the delivered VO duration (cutdur = VOdur times weight over the weight sum, so emotional beats hold longer), Ken-Burns-zoomed per still (scale 2x…
review-scraper
Scrape product reviews from G2, Capterra, and Trustpilot using Apify. Single script with platform dispatch. Use when you need to monitor competitor reviews, track product sentiment, or gather customer feedback from review sites.