Hooks and Automation
Hooks turn "please always run the formatter" from a hope into a guarantee — deterministic shell commands that fire on Claude Code's lifecycle events, no matter what the model decides.
Hooks are shell commands that fire deterministically on lifecycle events — auto-format on edit, block edits to protected paths, run checks, notify. When to use a hook (guarantee) vs CLAUDE.md (influence) vs permissions (gate), and keeping them safe.