Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Documents how to create, format, and publish Claude Code hooks, covering event types, JSON I/O, exit codes, and PRPM package structure.
Use this skill ↓45% 91%+45 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 10 of 22 without it.
3 of 3 safety checks passed
Not used yet
Use this skill when creating, improving, or publishing Claude Code hooks. Provides essential guidance on hook format, event handling, I/O conventions, and package structure.
Activate this skill when:
| Aspect | Requirement |
|---|---|
| Location | .claude/hooks/<event-name> |
| Format | Executable file (shell, TypeScript, Python, etc.) |
| Permissions | Must be executable (chmod +x) |
| Shebang | Required (#!/bin/bash or #!/usr/bin/env node) |
| Input | JSON via stdin |
| Output | Text via stdout (shown to user) |
| Exit Codes | 0 = success, 2 = block, other = error |
| Event | When It Fires | Common Use Cases |
|---|---|---|
session-start | New session begins | Environment setup, logging, checks |
user-prompt-submit | Before user input processes | Validation, enhancement, filtering |
tool-call | Before tool execution | Permission checks, logging, modification |
assistant-response | After assistant responds | Formatting, logging, cleanup |
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.