Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/create-hook/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/create-hook/

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.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set64

setup-arxiv-mcp Sets up an academic paper search MCP server through Docker MCP and records its tools in CLAUDE.md. Use it when an agent needs to search or read research papers. CX Codex +1 1,200installs attach-review-to-pr This skill shows the agent how to post review comments on specific lines of a pull request using GitHub CLI or an MCP tool. Handy when review happens in the terminal. CX Codex +1 1,200installs git-worktrees Teaches your AI coding assistant to manage multiple linked Git working trees. Helpful for handling hotfixes, PR reviews, and parallel builds without stashing changes. CX Codex +1 1,200installs actualize Checks an FPF knowledge base against Git changes and flags evidence or decisions that may need review. Use it before new work or after repository changes. CX Codex +1 1,200installs create-pr Opens draft pull requests through the GitHub CLI using repository templates. It checks for uncommitted changes and formats PR titles with emojis. CX Codex +1 1,200installs analyze-issue Analyzes a GitHub issue, reviews related code, and saves a technical specification. Use it before starting work on a tracked task. CX Codex +1 1,200installs apply-anthropic-skill-best-practices A skill that walks you through Anthropic's official skill-authoring rules while you build your own. Useful once a skill file grows past a few screens. CX Codex +1 1,200installs create-agent Scaffolds autonomous subagents for Claude Code with valid YAML frontmatter, isolated contexts, and triggering examples. CX Codex +1 1,200installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor