Hooks Reference

April 1, 2026 ยท View on GitHub

HookTriggerPurpose
namespace-hintSessionStartInject plugin command namespace guidance into Claude context
post-edit-formatAfter Edit/WriteAuto prettier + invalidate review state on edit
post-tool-review-stateAfter Bash / MCP toolsTrack review state (sentinel routing, supports namespaced commands)
pre-edit-guardBefore Edit/WritePrevent editing .env/.git
stop-guardBefore stopBlock or warn on incomplete reviews + stale-state git check (strict after install, warn in plugin runtime)
post-compact-auto-loopAfter context compactRe-inject auto-loop rules from state file
post-skill-auto-loopAfter Skill toolDetect review/precommit gate sentinels and update state
session-initSessionStart (startup)Initialize session state (drift sentinel, output style detection)
user-prompt-review-guardBefore each promptInject pending review reminder with cooldown (5min default)

Hooks are safe by default. Use environment variables to customize:

VariableDefaultDescription
STOP_GUARD_MODEstrict (installed) / warn (plugin runtime)strict blocks stop on missing review steps; warn only warns
HOOK_NO_FORMAT(unset)Set 1 to disable auto-formatting
HOOK_BYPASS(unset)Set 1 to skip all stop-guard checks
HOOK_DEBUG(unset)Set 1 to output debug info
GUARD_EXTRA_PATTERNS(unset)Regex patterns for extra protected paths (e.g. src/locales/.*\.json$)
REVIEW_GUARD_COOLDOWN300 (5 min)Seconds between pending review reminders

Dependencies: Hooks require jq. Auto-format requires prettier. Missing dependencies are handled gracefully.