create-hook — Claude Code skill: git hooks for your project
The skill scans your project and suggests hooks for your stack: type checks, formatting, linting, tests. Then it writes the script and tests it.
npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -a claude-codeWhat create-hook does
Four steps. First the skill looks at your configs: tsconfig.json, .prettierrc, .eslintrc.*, scripts in package.json. Then it suggests hooks that fit what it found — a type check after an edit, or blocking a commit with lint errors.
Next come the questions: when should it run (PreToolUse, PostToolUse, UserPromptSubmit), which tools to match (Write, Edit, Bash, *), and the scope (global, project, project-local). The script lands in ~/.claude/hooks/ or .claude/hooks/, and the settings go into settings.json. Use absolute paths via $CLAUDE_PROJECT_DIR — relative ones break as soon as the hook runs from another directory.
Inside the script, JSON comes from stdin, not argv. Claude reads additionalContext and systemMessage; suppressOutput: true keeps successful runs quiet. Blocking in PreToolUse means exit 2. After creating the hook, the skill offers to run both paths: the one that should pass and the one that should stop.
What it helps with
- type-check files right after an edit
- block commits that fail linting
- auto-format code on save
- catch secrets and keys before a commit
- run tests before committing
Example prompts for the agent
- create a hook that type-checks .ts files after editing
- I need a PreToolUse hook that blocks commits with secrets
- make a prettier auto-format hook and test it
How to install create-hook
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -a claude-code2Manually: put the files in place
~/.claude/skills/create-hook/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/create-hook/
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -a codex2Manually: put the files in place
.agents/skills/create-hook/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -a cursor2Manually: put the files in place
.cursor/skills/create-hook/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install NeoLabHQ/context-engineering-kit create-hook2Manually: put the files in place
.github/skills/create-hook/SKILL.md1Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -a gemini-cli2Platform CLI
gemini skills install https://github.com/NeoLabHQ/context-engineering-kit --path skills/create-hookManually: put the files in place
.devin/skills/create-hook/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about create-hook
How do I install create-hook in Claude?
Run npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -a claude-code. The skill ends up at ~/.claude/skills/create-hook/SKILL.md.
What does create-hook do?
It analyzes the project, suggests relevant git hooks, writes the script, and validates it against both a passing and a failing scenario.
Which hooks can it suggest?
It depends on your configs: type checking for tsconfig.json, formatting for .prettierrc, linting for .eslintrc.*. If package.json has test or build scripts, it suggests hooks for those.