Claude Code Hooks Reference
Anthropic's official hooks documentation — the authoritative reference for hook events, JSON input/output schemas, matchers, exit-code semantics, and security considerations.
The official reference documentation for Claude Code hooks. It specifies every lifecycle event (PreToolUse, PostToolUse, UserPromptSubmit, Notification, Stop, SubagentStop, PreCompact, SessionStart), the JSON schema each receives on stdin, how exit codes and JSON output control Claude's behavior (allow, deny, feedback), and how matchers target specific tools.
Read this before writing your first hook — most hook bugs come from guessing at the input schema or exit-code semantics that this page defines precisely.
Categories:
Ad