Hooks

Hooks enforce what an instruction can only request

every turn SessionStart injects the memory contract + project facts UserPromptSubmit surfaces memories the prompt matches PreToolUse blocks .env writes and rm -rf, fires tripwires exit 2 = blocked SubagentStart warms up a subagent with task-ranked memories PreCompact backs up the transcript before it is summarized Stop won't end a busy session with no saves
🧱Exit code 2 is a wallIt stops the call before permission rules are even checked, so an allow rule can't let it through.
🪤TripwiresA memory pinned to a command. Pin one to git push and it appears right before Claude pushes.
🧩23 events wiredEach hook is a small script. Type /hooks to see what yours run.