claude-hooks
npx machina-cli add skill aiskillstore/marketplace/claude-hooks --openclawClaude 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
Source
git clone https://github.com/aiskillstore/marketplace/blob/main/skills/89jobrien/claude-hooks/SKILL.mdView on GitHub Overview
This skill creates and configures hooks for Claude Code to automate workflows and extend functionality. It enables PreToolUse validation, PostToolUse logging/cleanup, and notification hooks to support auditing, security controls, and custom automation.
How This Skill Works
Hooks are defined and stored in ~/.claude/settings.json under the hooks key, using reference templates from references/CLAUDE_HOOK.template.md. The skill implements hook events (PreToolUse, PostToolUse, Notification, Stop) to cover validation, logging, alerts, and final reports, enabling configurable automation and safer tool interactions.
When to Use It
- Tool execution validation
- Audit logging
- Custom notifications
- Workflow automation
- Security controls
Quick Start
- Step 1: Open ~/.claude/settings.json and add a hooks section
- Step 2: Define PreToolUse, PostToolUse, and Notification hooks using references/CLAUDE_HOOK.template.md
- Step 3: Test hooks independently and monitor performance to ensure <1 second latency
Best Practices
- Keep hooks fast (< 1 second)
- Handle errors gracefully
- Use specific matchers
- Test hooks independently
- Avoid verbose output
Example Use Cases
- Block tool execution when input fails validation rules (PreToolUse)
- Log tool outputs and perform cleanup after tool use (PostToolUse)
- Send alerts or notifications on notable tool events (Notification)
- Trigger downstream workflows automatically after a tool completes
- Enforce security controls by restricting tool usage through hooks