Hooks
Hooks are shell commands Claude Code runs automatically in response to lifecycle events: PreToolUse, PostToolUse, UserPromptSubmit, Stop, Notification, and others. They're how you wire the Claude harness to your repo's conventions without depending on the model to remember.
What hooks enforce that prompts can't
A hook executes deterministically. The model can't forget it, skip it, or be social-engineered around it. That makes hooks the right tool when you need a guarantee:
- "Every tool call that writes to
production/must be confirmed." - "When Claude stops, run our formatter."
- "Block any commit that touches
secrets/."
If the rule is a guideline (style, tone, preference), use CLAUDE.md or memory. If the rule is a guarantee (security, compliance, formatting), use a hook.
What RBA ships here
The hooks in this catalog encode RBA's engagement standards — formatter integration, governance gates, audit trails. Each hook ships as part of a plugin so installing the plugin wires the hooks automatically; uninstalling the plugin removes them cleanly.
Authoring tip
Hooks should fail loud and fix themselves where possible. A hook that exits 1 with a clear message is worth more than one that silently mutates state. Prefer dry-run output the developer can review.