claude-code-hooks
SKILL.md
Claude Code Hooks
This skill provides assistance for working with Claude Code hooks to enable automation of workflows and integration of external tools through an event-driven system.
About Hooks
Hooks are event-driven automation scripts that execute automatically when specific events occur during Claude Code's operation. Think of them as "middleware" for Claude's actions—they intercept events to validate inputs, enrich context, automate workflows, or integrate external tools, transforming Claude from a general assistant into a policy-aware, context-enriched agent.
What Hooks Provide
- Input validation - Block dangerous operations, enforce security policies, prevent path traversal
- Workflow automation - Auto-format code, run linters, backup files, send notifications
- Context enrichment - Load git status, inject project context, add session information
- External integration - Connect to APIs, trigger CI/CD, log to external systems
- Decision control - Auto-approve safe operations, require confirmation for sensitive actions
Anatomy of a Hook
Every hook consists of configuration in settings.json and an optional validation script: