Architecture

Hook lifecycle — what fires when

Session Start
  |
  |-- SessionStart hook --> inject workspace context
  |-- session-lifecycle rule --> reads memory files
  |-- load-session skill --> full context restore
  |
Active Session
  |
  |-- PreToolUse  (Bash) --> block-git-push.sh
  |-- PreToolUse  (Write) --> protect-config.sh
  |-- PostToolUse (Write) --> notify-file-changed.sh
  |-- PostToolUse (Bash) --> post-commit-review.sh
  |-- PreCompact  --> precompact-state.sh
  |-- PostCompact --> restore awareness prompt
  |-- Stop        --> security check (sonnet)
  |                + session-checkpoint + cost-tracker
  |
Session End
  |-- session-checkpoint.sh (sync, guaranteed)