Hooks
Hooks are accelerators and guards — they do not replace plans, contracts, reviews, or
checks. Every route is addressed by event + routeId + matcher, and the guard routes
fail closed.
Managed routes
Section titled “Managed routes”| Event | Route | Matcher | Does |
|---|---|---|---|
SessionStart | .default | all sessions | inject the prior session’s resume packet |
PreToolUse | .edit 🛡 | Edit / Write | hold edits until a plan is approved |
PreToolUse | .subagent 🛡 | Task / Agent | scope delegated work |
PostToolUse | .edit | Edit / Write | architecture-drift + contract checks |
PostToolUse | .bash | Bash | trace shell commands |
PostToolUse | .always | all tools | append to the event trace |
UserPromptSubmit | .default | all prompts | route intent, surface plan status |
Stop | .default 🛡 | session stop | write the next handoff packet |
🛡 = fails closed.
Where they live
Section titled “Where they live”The installable source is assets/hooks/; the active runtime resolves central-first.
User-level ~/.claude/settings.json and ~/.codex/hooks.json are the host adapters
that dispatch each event into the harness. Repo-local .claude/hooks/ and
.codex/hooks.json are legacy cleanup targets — only your own custom-*.sh hooks are
preserved.