Claude Code hooks
Checks at a defined event
A hook runs at a defined point in a Claude Code workflow. It can inspect an attempted action or react to a result, depending on the event. The official hook reference, checked November 14, 2026, documents event-specific input and decision behavior. Read the event you intend to use before choosing an exit code or response.
For a fictional repository, a pre-action check should reject a command that sends an environment file to an external address. A message in CLAUDE.md can state the same rule, but the configured check has a separate failure path that you must test.
Failure behavior
Test an allowed action, a denied action and a broken check. If the checking process crashes, confirm whether the intended action proceeds. Do not assume every nonzero exit blocks every event. The browser exercise practices the decision; it does not run a shell hook or inspect your computer. Continue with permission boundaries and skill scripts.