Type: url
Original: https://hidekazu-konishi.com/entry/claude_code_hooks_complete_guide.html
Status: generated
Summary
Hidekazu Konishi’s June 2026 guide treats hooks in Claude Code’s CLI as a deterministic enforcement layer, contrasting them with prompts and CLAUDE.md, which the model follows only probabilistically. It walks through where each of roughly thirty hook events fires in a turn, how a hook answers through exit codes or JSON (with PreToolUse using a distinct permissionDecision shape), how matchers and the settings hierarchy scope hooks, and a set of worked examples. It closes by comparing hooks with permissions and CLAUDE.md and by setting out the security model and common pitfalls of hooks that run with the user’s full shell privileges.