What problem does it solve?
Generate-hook converts mature Claude Code correction rules into practical hook skeletons so you can automatically warn or block problematic tool behavior without manually writing boilerplate.
Core Features & Use Cases
- Rule-to-hook generation: Creates a PreToolUse or PostToolUse hook template from a selected rule text or rule number.
- Smart hook-type selection: Infers hook type and matcher (Edit/Write vs Bash) based on rule patterns like “never use…”, “don’t run…”, or “always check…”.
- Local deployment instructions: Produces a ready-to-add settings.json snippet and places the generated hook script into the expected hooks directory.
Example use case: If your CLAUDE.md rule says “Before deploying, verify tests passed,” generate-hook can scaffold a PreToolUse hook that inspects the relevant deploy-related tool inputs and returns warning feedback by default.
Quick Start
Ask an AI editor to run generate-hook with your rule text or the rule number, then copy the shown settings.json entry into your ~/.claude/settings.json.