$ ls ~/.claude/hooks/*.sh | wc -l → 35
/hooks enforcement
Hooks fire on Claude Code lifecycle events (PreToolUse, PostToolUse, UserPromptSubmit, Stop). They run as shell scripts; exit code controls behaviour. Severity ladder: block → enforce → warn → remind.
severity ladder
BLOCK
exit 2 — hard deny, refuses tool call
ENFORCE
exit 1 — must fix before retry
WARN
exit 0 + stderr — proceeds with advisory
REMIND
exit 0 + stderr on UserPromptSubmit
| FILE | EVENT | SEVERITY | RULE |
agent-capability-check.sh | | info | |
agent-capability-verify.sh | | info | |
agent-fork-done.sh | | info | |
agent-fork-logger.sh | | info | |
agent-heartbeat-tick.sh | | info | |
agent-stub-scan.sh | | info | |
alignment-check.sh | | info | |
assemble-agents.sh | | info | |
assemble-validate.sh | | info | |
block-dangerous.sh | | info | |
check-error-patterns.sh | | info | |
citation-verify.sh | | info | |
destructive-guard.sh | | info | |
disk-headroom-check.sh | | info | |
disk-reclaim.sh | | info | |
error-spike-detector.sh | | info | |
extract-task-durations.sh | | info | |
milestone-commit-hook.sh | | info | |
no-downgrade.sh | | info | |
no-hand-edit-agents.sh | | info | |
no-python-without-approval.sh | | info | |
numeric-claims-guard.sh | | info | |
orchestrator-branch-check.sh | | info | |
orchestrator-dirty-check.sh | | info | |
phase-b-rem.sh | | info | |
post-commit-audit.sh | | info | |
post-write-check.sh | | info | |
recurrence-suggest.sh | | info | |
rust-first.sh | | info | |
safety-guard.sh | | info | |
session-end-dump.sh | | info | |
site-wysiwyd-check.sh | | info | |
stop-verify.sh | | info | |
task-timer.sh | | info | |
tomd-preread.sh | | info |
register your own hook
{
"hooks": {
"PreToolUse": [
{
"match": "Bash",
"hooks": ["~/.claude/hooks/my-guard.sh"]
}
]
}
}Use /escalate-recurrence skill to auto-generate the hook + register it via update-config.