Hooks are shell commands that run at specific points in Claude's lifecycle. They give you deterministic control over what happens before and after Claude acts.
Here's the difference between hooks and instructions in CLAUDE.md: instructions are suggestions Claude interprets, but hooks are code that runs regardless of what Claude decides. I mention this because it changes how you think about enforcement.
Events you can hook into:
PreToolUse: before any tool runsPostToolUse: after a tool succeedsSessionStart: when a session beginsStop: when Claude finishes respondingNotification: when Claude needs your attentionUserPromptSubmit: when you submit a prompt