clickai.dev
← Legend / The harness

Hook

A hook is a shell command the harness runs at a fixed point in the agent's loop — not a request to the model. Exit codes are the interface, and the exact code matters: in Claude Code an exit of 2 blocks the transition the hook fired on and feeds the hook's stderr back to the model, while any other non-zero exit is reported and then allowed through. Writing “exit 1” in a validator and assuming it blocks is the common way to ship a gate that gates nothing. It is the only lever on this page the model cannot argue with, which is also why an untrusted repository that can write a hook has execution on your machine. The distinction worth holding: an instruction is obeyed by disposition, a hook is enforced by the harness.

establishedSettled. Documented by a primary source and not seriously disputed.

Legend last revised .