create-hook

create-hook is a skill for Claude Code from KhaledSaeed18/dotclaude. It costs 62 tokens per session (1,226 once invoked), scanned A, original, MIT.

A repository workflow for creating a Claude Code hook: a script that runs on an event such as before a tool call, after a prompt, or when a session stops. It creates the script, its documentation, and the settings needed to activate it.

In plain words
What is it for?
Use it to create, scaffold, or review hooks in this repository, including their lifecycle event, script, settings.json entry, documentation, and generated catalogue entry.
Why use it?
It avoids wiring hooks by hand and documents the exact configuration users must add, since installing the files alone does not activate a hook. It also checks that the hook behaves safely.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Use it to create, scaffold, or review hooks in this repository, including their lifecycle event, script, settings.json entry, documentation, and generated catalogue entry.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khaledsaeed18/dotclaude/create-hook
Install

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.

Any agent
npx skills add KhaledSaeed18/dotclaude --skill create-hook
Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

Made for: Claude Code.

Wrote 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.

agentmods badge for create-hook

README.md
[![agentmods](https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/create-hook/github.svg)](https://agentmods.dev/skills/khaledsaeed18/dotclaude/create-hook)
Your own site
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/create-hook"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/create-hook/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for create-hook

Your own site · 80×15
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/create-hook"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/create-hook.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,226 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.01226
Opus 5.5 $0.00025 $0.00490
Sonnet 5.5 $0.00012 $0.00245
Haiku 4.5 $0.00006 $0.00123

Measured 2mo ago against content hash 836ca4b5770d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

create-hook scanned grade A with 0 findings 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 2mo ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/engineering/create-hook/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Create a hook: a script Claude Code runs on a lifecycle event (before a tool, after a prompt, on stop, and so on). Make it do one deterministic thing, fail safe, and ship with documentation a user can paste into settings.json. Then regenerate the derived files and validate.

Source layout is hooks/<category>/<name>/HOOK.md plus the script. Hooks are folder-layout: the whole folder installs to .claude/hooks/<name>/, so the script and any helpers ride along. The category is the folder; registry.json and the README catalog are generated by pnpm gen. Never hand-edit generated files.

Hooks differ from skills, agents, and commands in one critical way: they are configuration, not a loadable file. The shadcn installer copies the script and HOOK.md but cannot edit a user's settings.json. So HOOK.md must document the exact settings block to add, and the hook is inert until the user adds it.

Hard rules: never break these

  • Fail safe and non-blocking by default. Unless the hook's job is to block, swallow its own errors and exit 0 so it can never interrupt or break a tool call or session. Exit 2 only when blocking is the intended behavior for that event.
  • HOOK.md must document activation. Include the precise settings.json block, the event, the matcher, and the command line. Without it the hook does nothing after install.
  • Be safe with data. Hooks see tool inputs and outputs. Redact secret-looking fields and truncate large payloads before logging or sending anything.
  • Zero or pinned dependencies. Prefer the language's standard library so the script runs anywhere it lands. State the runtime requirement.
  • name is globally unique and equals the folder name, kebab-case.
  • Never hand-write registry.json or the README catalog. Run pnpm gen.
  • No AI/co-author mentions anywhere in the hook or its output.

Step 1: Define the hook

  • The one thing it does, in a sentence.
  • The event it fires on and whether it needs a matcher (for example PreToolUse matched to Bash). Event list, matcher support, and the input/exit-code contract: reference/events.md.
  • Blocking or observing. Does it just record/notify (exit 0), or veto an action (exit 2 on the right event)?

Read the full file on GitHub · 75 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 2mo ago Changed 836ca4b5770d
  2. 3mo ago First seen · 75 lines · 62 tokens per session scan A 28ded0c1a48a

Subscribe to this mod's changes

create-hook is a skill published in the GitHub repository KhaledSaeed18/dotclaude (7 stars, last pushed 3d ago), licensed MIT. It adds 62 tokens to every session and 1,226 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

create-hook compared with skills from other repositories

create-hook next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
create-hookKhaledSaeed18/dotclaudeSkill73d agoMITA62Claude Code
stakeholder-communicationrampstackco/claude-skillsSkill1.1k14d agoMITA103Claude Code
analytics-strategyrampstackco/claude-skillsSkill1.1k14d agoMITA126Claude Code
content-strategyrampstackco/claude-skillsSkill1.1k14d agoMITA120Claude Code
gueter-genehmigung-bearbeitenKlotzkette/claude-fuer-deutsches-rechtSkill1.9k2d agoApache-2.0A62Claude Code
review-workcode-yeongyu/oh-my-openagentSkill71ktodaynoneA63Claude Code, Codex
agb-rechtswahl-schweizer-recht-rom-iKlotzkette/claude-fuer-deutsches-rechtSkill1.9k2d agoApache-2.0A69Claude Code