
Claude Hooks
- 27 installs
- 4 repo stars
- Updated April 11, 2026
- 89jobrien/steve
claude-hooks is a Claude Code skill that creates and configures hooks - PreToolUse, PostToolUse, Notification, and Stop - for tool validation, logging, notifications, and automation.
About
claude-hooks is a Claude Code skill that creates and configures hooks to automate workflows and extend Claude Code. It covers PreToolUse validation, PostToolUse logging and cleanup, notification hooks, and custom automation. A developer uses it to add tool-execution validation, audit logging, or security controls to their Claude Code setup. Hooks are configured in ~/.claude/settings.json and it ships a hook-template reference.
- Creates and configures Claude Code hooks for validation, logging, and automation
- Covers PreToolUse, PostToolUse, Notification, and Stop hook events
- Configures hooks in ~/.claude/settings.json with a bundled template
Claude Hooks by the numbers
- 27 all-time installs (skills.sh)
- Ranked #9,601 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 28, 2026 (Skillselion catalog sync)
claude-hooks capabilities & compatibility
- Capabilities
- hook configuration · tool validation · audit logging · agent automation
- Use cases
- orchestration · security audit
- Pricing
- Free
What claude-hooks says it does
Creates and configures hooks for Claude Code to automate workflows and extend functionality.
Hooks are configured in `~/.claude/settings.json` under the `hooks` key.
npx skills add https://github.com/89jobrien/steve --skill claude-hooksAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 27 |
|---|---|
| repo stars | ★ 4 |
| Last updated | April 11, 2026 |
| Repository | 89jobrien/steve ↗ |
What it does
Create and configure Claude Code hooks for tool validation, logging, notifications, and custom automation.
Who is it for?
Adding validation, logging, notification, or automation hooks to a Claude Code setup
Skip if: Hook systems for tools other than Claude Code
When should I use this skill?
You are creating hooks for tool validation, logging, notifications, or custom automation in Claude Code
What you get
Configured Claude Code hooks (validation, logging, notification, automation) in settings.json.
- configured hooks in settings.json
- PreToolUse/PostToolUse/Notification/Stop hook definitions
By the numbers
- 4 documented hook events (PreToolUse, PostToolUse, Notification, Stop)
Files
Claude Hooks Skill
Creates and configures hooks for Claude Code to automate workflows and extend functionality.
What This Skill Does
- Creates PreToolUse validation hooks
- Sets up PostToolUse logging/cleanup
- Configures notification hooks
- Implements custom automation
- Documents hook patterns
When to Use
- Tool execution validation
- Audit logging
- Custom notifications
- Workflow automation
- Security controls
Reference Files
references/CLAUDE_HOOK.template.md- Hook configuration examples and patterns
Hook Events
| Event | Trigger | Use Case |
|---|---|---|
| PreToolUse | Before tool executes | Validation, blocking |
| PostToolUse | After tool completes | Logging, cleanup |
| Notification | Claude sends notification | Alerts |
| Stop | Claude stops | Final reports |
Configuration Location
Hooks are configured in ~/.claude/settings.json under the hooks key.
Best Practices
- Keep hooks fast (< 1 second)
- Handle errors gracefully
- Use specific matchers
- Test hooks independently
- Avoid verbose output
Hook Configuration Template
Hooks are shell commands that execute in response to Claude Code events.
Hook Configuration Location
Hooks are configured in ~/.claude/settings.json under the hooks key.
Hook Events
| Event | Trigger | Use Case |
|---|---|---|
PreToolUse | Before any tool executes | Validation, logging, blocking |
PostToolUse | After tool completes | Cleanup, notifications, post-processing |
Notification | When Claude sends notification | Custom alerts, integrations |
Stop | When Claude stops | Cleanup, final reports |
Configuration Structure
{
"hooks": {
"{{EVENT_NAME}}": [
{
"matcher": "{{TOOL_OR_PATTERN}}",
"hooks": [
{
"type": "command",
"command": "{{SHELL_COMMAND}}"
}
]
}
]
}
}Examples
Pre-Tool Validation Hook
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "echo 'Executing bash command...'"
}
]
}
]
}
}Post-Tool Logging Hook
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write",
"hooks": [
{
"type": "command",
"command": "echo 'File written: $CLAUDE_FILE_PATH' >> ~/.claude/file_log.txt"
}
]
}
]
}
}Notification Hook
{
"hooks": {
"Notification": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "osascript -e 'display notification \"$CLAUDE_MESSAGE\" with title \"Claude Code\"'"
}
]
}
]
}
}Environment Variables Available
| Variable | Description | Available In |
|---|---|---|
$CLAUDE_TOOL_NAME | Name of tool being executed | PreToolUse, PostToolUse |
$CLAUDE_TOOL_INPUT | JSON input to tool | PreToolUse, PostToolUse |
$CLAUDE_TOOL_OUTPUT | JSON output from tool | PostToolUse |
$CLAUDE_FILE_PATH | Path for file operations | Write, Edit, Read |
$CLAUDE_MESSAGE | Notification message | Notification |
Matcher Patterns
| Pattern | Matches |
|---|---|
* | All tools |
Bash | Bash tool only |
Bash(git:*) | Bash commands starting with git |
Write | Write tool only |
mcp__* | All MCP tools |
Best Practices
1. Keep hooks fast - Long-running hooks block Claude 2. Use async for slow operations - Background with & if needed 3. Handle errors gracefully - Don't let hook failures break workflow 4. Log sparingly - Avoid verbose output that clutters context 5. Test hooks independently - Verify shell commands work before adding
Quality Checklist
- [ ] Event type matches intended trigger
- [ ] Matcher pattern is specific enough
- [ ] Command executes quickly (<1s)
- [ ] Error handling prevents cascade failures
- [ ] Environment variables used correctly
- [ ] Hook tested in isolation before deployment
Related skills
FAQ
What hook events are available?
PreToolUse (before a tool executes), PostToolUse (after it completes), Notification (when Claude sends a notification), and Stop (when Claude stops).
Where are hooks configured?
In ~/.claude/settings.json under the hooks key.