create-hooks

Automate creation and configuration of Claude Code hooks for event-driven scenarios.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/gahoccode/PRDs --skill create-hooks-gahoccode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-hooks
Source: https://github.com/gahoccode/PRDs/tree/main/skills/create-hooks
Command: npx skills add https://github.com/gahoccode/PRDs --skill create-hooks-gahoccode

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Hooks are complex event-driven automations for Claude Code. This Skill provides expert guidance on creating, configuring, and debugging hooks to automate workflows, validate commands, inject context, and implement custom criteria without touching core code.

Core Features & Use Cases

  • Step-by-step guidance to create hook configs (events, matcher patterns, and hook types)
  • Clear workflow for testing and debugging hooks with claude --debug
  • Patterns for blocking or modifying tool inputs, injecting context, and logging
  • Guidance on common hook scenarios (PreToolUse, PostToolUse, Stop, SessionStart, etc.)

Quick Start

Define a basic PreToolUse hook for Bash that logs commands to a file and test with claude --debug to verify behavior.

Frequently Asked Questions about create-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Claude Code hooks for event-driven workflows?

Event-driven hooks automate actions triggered by Claude Code events like PreToolUse, PostToolUse, SessionStart, and UserPromptSubmit. Define hook configurations specifying event types, matcher patterns, and actions—such as validating commands, blocking unsafe operations, or injecting context—without modifying core code.

What types of hooks can I create in Claude Code?

Claude Code supports command hooks and prompt hooks. Command hooks intercept and validate tool executions; prompt hooks process user input. Both types use matcher rules, input/output schemas, and permission controls to log activity, modify inputs, block unsafe actions, and enforce custom completion criteria.

How do I test and debug hooks in Claude Code?

Use the `claude --debug` flag to test hooks and verify behavior. Debug mode outputs hook execution details, matcher rule evaluation, and input/output transformations, helping you identify configuration errors and validate that hooks trigger on the correct events and modify data as intended.

Can I use hooks to block or modify tool commands?

Yes. PreToolUse hooks intercept tool inputs before execution, allowing you to validate commands, block unsafe operations, modify parameters, and inject context. PostToolUse hooks process tool outputs for logging, filtering, or transformation after execution completes.

What do I need to configure for a hook to work?

Hook configuration requires specifying the event type (PreToolUse, PostToolUse, Stop, SessionStart, etc.), matcher patterns to filter which operations trigger the hook, hook type (command or prompt), input/output schemas, environment variables, and permission controls defining allowed actions and safety checks.

Why would I use hooks instead of modifying Claude Code directly?

Hooks enable workflow automation, validation, and logging without touching core code. They provide a declarative, event-driven layer for implementing custom criteria, access controls, activity tracking, and context injection—keeping your automation logic separate and maintainable.