Hooks

Policy without forking the harness. Format is Zox-only: .zox/hooks.json and optional ~/.config/zox/hooks.json. Project hooks require trust:

sh
zox hooks trust --workspace .

Examples in the repo: examples/hooks/ (guard-destructive.sh, account-tokens.sh, prior-state / reinject scripts).

Jev runs before UserPromptSubmit so hooks see prompts the user (or ask-flow) already allowed.

Events (MVP eight)

EventWhenCan block?
SessionStartCreate/resumeInject only
UserPromptSubmitAfter Jev (if any), user message acceptedYes
PreToolUseBefore toolYes
PostToolUseAfter toolNo
PreCompactBefore compactionYes
PostCompactAfter compactionNo
StopModel wants to endYes
SessionEndCloseNo (auto-summarize memory)

Command hooks: JSON on stdin, JSON on stdout (decision: allow | deny | ask). Exit 2 = deny. Other failures typically warn and continue.