TL;DR
Claude Code hooks are shell commands the runtime runs on set events. Those events include a tool call, session start, stop and a file change. Hooks run outside the model, and a failing exit code can block the action. Use them only for rules that must never break, like a secret scan or the tests.
A rule written in CLAUDE.md is a request. A hook is a rule.
One survey of 2,500 public Claude Code repos found hooks in 13.3% of them, so most projects run on requests.
The order that worked in mine: write the promise, add a check that fails, then wire the gate.
Someone opened an issue on my repo two weeks ago that I could not argue with.
The bootstrap message printed a line saying Claude reads your _CLAUDE.md automatically on every session. A contributor named motkoning pointed out that this is true only when three separate pieces of wiring are all in place: a SessionStart hook, an environment variable pointing at the vault, and a session actually started inside that vault.…