What problem does it solve?
Many developers struggle with the complexity of Claude Code hooks, often falling into common traps such as non‑blocking exit codes, incorrect matcher syntax, and unsafe updatedInput handling. This Skill provides a clear, authoritative guide to writing correct, secure hooks and avoids the most frequent pitfalls.
Core Features & Use Cases
- Comprehensive Hook Mechanics: Detailed explanations of all 24+ events, matcher modes, exit‑code contracts, and handler types (command, http, prompt, agent).
- Anti‑Pattern Checklist: Quick reference to the 14 most common mistakes, including the exit‑code‑1 trap, infinite Stop loops, and matcher regex pitfalls.
- Practical Reference Implementations: Ready‑to‑use
hooks.json examples for PreToolUse blockers, PostToolUse formatters, SessionStart context injection, Stop loop guards, Notification alerts, FileChanged watchers, and WorktreeCreate provisioning.
Quick Start
Use the plugin-hooks skill to get step‑by‑step guidance for creating a PreToolUse hook that blocks risky commands.