skills/smithery.ai/create-hooks

create-hooks

SKILL.md

Create Hooks Guide

This skill helps you create Claude Code hooks - user-defined shell commands that execute at specific points in Claude Code's lifecycle. Hooks provide deterministic control over behavior rather than relying on LLM decisions.

Quick Start

When creating a new hook, follow this workflow:

  1. Identify the event - Which lifecycle event should trigger the hook?
  2. Define the action - What shell command should execute?
  3. Configure matcher - Which tools should trigger (specific tool or * for all)?
  4. Test the command - Verify the shell command works independently
  5. Add to settings.json - Register the hook in ~/.claude/settings.json
  6. Test in Claude Code - Verify the hook executes and behaves correctly
  7. Review security - Ensure no credential leakage or malicious behavior

Hook Events

Claude Code supports nine hook events:

Installs
2
First Seen
Mar 27, 2026