Use Hooks for Non-negotiable Checks
Instructions are advisory. Hooks are deterministic.
Use hooks when something should happen every time without relying on Claude remembering it from CLAUDE.md or the prompt.
Good hook candidates
Section titled “Good hook candidates”- Run a formatter after edits.
- Run lint or typecheck before stopping.
- Block writes to sensitive folders.
- Prevent edits to generated files.
- Deny reads from secret paths.
- Require a verification command before a task ends.
When to use hooks instead of instructions
Section titled “When to use hooks instead of instructions”Use a hook when forgetting the action would create a real problem.
Keep guidance in CLAUDE.md when it is contextual, judgment-based, or occasionally useful. Promote it to a hook when it is mandatory and mechanical.
Workflow
Section titled “Workflow”Run:
/hooksUse the hook browser to inspect configured hooks, or edit .claude/settings.json directly when you know the exact rule you want.