Get the FREE Ultimate OpenClaw Setup Guide →

claude-hooks

npx machina-cli add skill aiskillstore/marketplace/claude-hooks --openclaw
Files (1)
SKILL.md
1.3 KB

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

EventTriggerUse Case
PreToolUseBefore tool executesValidation, blocking
PostToolUseAfter tool completesLogging, cleanup
NotificationClaude sends notificationAlerts
StopClaude stopsFinal 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

  1. Step 1: Open ~/.claude/settings.json and add a hooks section
  2. Step 2: Define PreToolUse, PostToolUse, and Notification hooks using references/CLAUDE_HOOK.template.md
  3. 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

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers