Hooks are event-driven automation for Claude Code that execute shell commands or LLM prompts in response to tool usage, session events, and user interactions. This skill teaches you how to create, configure, and debug hooks for validating commands, automating workflows, injecting context, and implementing custom completion criteria.
Hooks provide programmatic control over Claude's behavior without modifying core code, enabling project-specific automation, safety checks, and workflow customization.
Hooks are shell commands or LLM-evaluated prompts that execute in response to Claude Code events. They operate within an event hierarchy: events (PreToolUse, PostToolUse, Stop, etc.) trigger matchers (tool patterns) which fire hooks (commands or prompts). Hooks can block actions, modify tool inputs, inject context, or simply observe and log Claude's operations.
Guida esperta per creare, configurare e utilizzare gli hook Claude Code. Da utilizzare quando si lavora con hook, si impostano ascoltatori di eventi, si convalidano comandi, si automatizzano flussi di lavoro, si aggiungono notifiche o si comprendono i tipi di hook (PreToolUse, PostToolUse, Stop, SessionStart, UserPromptSubmit, ecc.). Fonte: kyldvs/setup.