Artifact f4cfd070afd30282ee4c367532869ad3b251a3be1f144a9ab25590b30b7be9a2:
- File docs/reference/hook-events.md — part of check-in [ffe171259d] at 2026-11-24 13:42:18 on branch guard-hooks — Required hooks fail closed; PostToolUse runs on ! and pic bash (user: dmestas, size: 1350) [annotate] [blame] [check-ins using] [more...]
Hook events
The Claude Code hook events pic fires. How hooks are configured and what their output does is in hooks.
| Event | When | Can block |
|---|---|---|
SessionStart |
a conversation opens; output becomes context | no |
UserPromptSubmit |
before a message is sent; output becomes context; its input's origin is user, or who sent it (session:JOURNAL/CONVERSATION for another conversation, cli, attach, remote:DEVICE) |
yes |
PreToolUse |
before a tool call; permissionDecision or exit 2 denies it, as does a required hook that does not finish |
yes |
PostToolUse |
after a tool call, and as Bash after a ! or pic bash command; output becomes context; a required hook that does not finish withholds the output |
yes |
PreCompact |
before a compaction; output becomes context | no |
PreRequest |
before a reply request; answered by pic's compaction component, which may compact first; no command hook runs | no |
Stop |
when a reply ends with no tool calls | yes |
SessionEnd |
when a conversation closes | no |
A PreToolUse answer may also rewrite the call it allows (hookSpecificOutput.updatedInput), and a
PostToolUse answer may replace the result the model sees (hookSpecificOutput.updatedToolOutput);
hooks says what pic does with each.