create-hooks

Create and manage Claude Code hooks for command validation and workflow automation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert guidance for creating, configuring, and using Claude Code hooks. It helps you automate event-driven workflows, validate commands, add notifications, and understand hook types (PreToolUse, PostToolUse, Stop, SessionStart, UserPromptSubmit, etc.), without touching core Claude code.

Core Features & Use Cases

  • Hook design guidance: Learn how to create, configure, and debug hooks for command validation, workflow automation, and context injection.
  • Event-driven automation: Automate Claude Code behavior around tool usage and session events to reduce manual toil and errors.
  • Safety and observability: Include checks, logging, and notifications to improve safety and transparency.

Quick Start

Start by creating a basic PreToolUse hook configuration that logs each tool input to a file and validates the command pattern.

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 command validation with hooks?

Hooks automate command validation by intercepting events like PreToolUse and PostToolUse. Create a hook configuration with matcher rules and validation logic to block, log, or transform commands before execution, reducing manual checks and improving safety without modifying core Claude Code.

What are the different Claude Code hook types and when should I use each?

Claude Code supports PreToolUse, PostToolUse, Stop, SessionStart, and UserPromptSubmit hooks. PreToolUse validates commands before execution, PostToolUse processes results, SessionStart initializes state, UserPromptSubmit filters prompts, and Stop handles cleanup—each serves specific automation and observability needs.

Can I use hooks to add logging and notifications to my workflows?

Yes. Hooks let you capture tool inputs, outputs, and session events to log to files or external systems and trigger notifications. Configure listeners on hook events to track execution flow, errors, and decisions, providing full transparency and audit trails for your automated workflows.

How do I configure JSON schema validation in hooks for tool inputs?

Hooks support JSON-based input/output schemas with matcher-based tool filtering. Define schemas in your hook configuration to validate command arguments and structure before execution, ensuring only compliant inputs proceed and blocking invalid requests automatically.

Do I need to modify Claude Code core to implement event-driven automation?

No. Hooks operate independently of Claude Code internals. Configure them as external event listeners that respond to PreToolUse, PostToolUse, and other session events—enabling automation, validation, and safety checks without touching core code.

What's the best way to debug failing hook configurations?

Implement logging hooks on SessionStart and PreToolUse events to track hook execution and matcher results. Log configuration state, event payloads, and decision outcomes to identify mismatched patterns or validation failures quickly.