Checks that block
A gate blocks a change until it passes; everything else advises. Inside the session, hooks are what turn a check into a gate, because they give “deterministic control: certain actions always happen rather than relying on the LLM to choose to run them” (source: Anthropic: Hooks guide).
The four rungs, from the inside
Section titled “The four rungs, from the inside”Verify with gates lists the four rungs and places this site’s checks on them. Underneath, they are made of different things.
The first is a prompt, an instruction the agent may follow. The second and the third are both Stop hooks. “/goal is a wrapper around a session-scoped prompt-based Stop hook” (source: Anthropic: /goal): “each time Claude finishes a turn, Claude Code sends the condition and the conversation so far to your configured small fast model” (source: Anthropic: /goal), and since that model “doesn’t run commands or read files independently” (source: Anthropic: /goal), the condition has to be something the agent’s own output shows. A Stop hook in your settings “can run a script for deterministic checks or a prompt for model-evaluated ones” (source: Anthropic: /goal), and only the script returns the same result every time. The fourth is a second model’s review, which Matt Pocock’s dictionary places exactly: “a filter that raises the floor before a human looks, not a gate that replaces one” (source: Matt Pocock: Dictionary of AI coding, automated review). So on this site the gates are the deterministic checks: the Stop hook’s script, the git hooks and the jobs CI runs.
What exit code 2 blocks
Section titled “What exit code 2 blocks”A hook is a command Claude Code runs when its event fires, and what it can stop depends on the event. In the hooks reference, exit code 2 is the way a hook signals “stop, don’t do this” (source: Anthropic: Hooks reference), with an effect per event:
| Event | On exit 2 |
|---|---|
PreToolUse |
Blocks the tool call |
Stop |
Prevents Claude from stopping, continues the conversation |
PostToolUse |
Shows its error output to Claude; the tool already ran |
Any other non-zero exit code is what the reference calls a non-blocking error: “the action goes ahead, except for hooks whose failure blocks the action, for example a hook with onFailure set to "block"” (source: Anthropic: Hooks reference). So a check script exits 2 on failure, never 1. A Stop hook has one exception: “when your hook exits 2 with nothing on stdout and its stderr says a file is missing, such as No such file or directory, Claude Code treats the run as a non-blocking error” (source: Anthropic: Hooks reference). This site’s script writes only to stderr, so a cd that fails on a missing folder would let the agent stop. The minimal setup shows the script, the type check and the unit tests it runs, and why it leaves out the guide’s guard against a loop.
Git hooks and CI
Section titled “Git hooks and CI”The agent’s hooks run inside its session. Two more layers check whatever the session produced, whoever commits it.
Git hooks. This repository’s pre-commit and commit-msg hooks check every commit, and its message, against the confidentiality list; the prepare script in package.json makes them git’s hooks. The list itself stays local and untracked, so the hooks pass on a machine without it. The instruction file says never to skip them with --no-verify, and that line is advice: the gate behind it is the confidentiality job CI runs.
CI. Every pull request and every push to main run three jobs: the site’s checks and browser tests, axe among them; Lighthouse on the landing and the introduction; and the confidentiality check, which reads its own copy of the list from a secret and fails when the secret is missing. Verify with gates lists what the jobs run; the browser tests stay in CI, out of the Stop hook.
The design hooks
Section titled “The design hooks”Impeccable’s hooks are checks of a softer kind. In Claude Code they give “focused feedback after edits, followed by a broader check when the agent finishes its turn” (source: Impeccable: Hooks), and the per-edit pass looks for “broken images, overflow, poor legibility, gradient text, glow, and design-system drift” (source: Impeccable: Hooks). A finding goes back to the agent, which “can fix the issue, or explain an intentional choice” (source: Impeccable: Hooks); in Cursor alone, “a finding can block the write” (source: Impeccable: Hooks). So in Claude Code the design hooks inform rather than block: “findings give the agent a chance to correct a problem while the change is still in context” (source: Impeccable: Hooks), and nothing in this repository blocks on a finding.
Silence is not a pass: “no messages can mean a clean edit, quiet mode, or an inactive hook” (source: Impeccable: Hooks). The detector also runs on its own: “use JSON when a script or CI job needs the results” (source: Impeccable: Detector). It exits 2 on a “scan completed with primary findings” (source: Impeccable: Detector) and 1 when “at least one target could not be scanned” (source: Impeccable: Detector), while “advisories are additional observations; they do not make a scan fail” (source: Impeccable: Detector).
Permission modes
Section titled “Permission modes”A permission mode “sets which actions Claude can take in a session without asking you first” (source: Anthropic: Choose a permission mode). In the terminal, “press Shift+Tab to cycle permission modes” (source: Anthropic: Choose a permission mode): from auto, “the cycle then runs default → acceptEdits → plan” (source: Anthropic: Choose a permission mode), and “optional modes slot in after plan” (source: Anthropic: Choose a permission mode). There are six, as Anthropic’s page on permission modes (source: Anthropic: Choose a permission mode) sets them out:
| Mode | Runs without asking | For |
|---|---|---|
default |
Reads only | Reviewing every action yourself |
acceptEdits |
Reads, file edits, common file commands | Iterating on code you review |
plan |
Reads; edits wait for an approved plan | Exploring before any change |
auto |
Everything, with background safety checks | Long runs |
dontAsk |
Pre-approved tools; the rest is denied | Locked-down CI and scripts |
bypassPermissions |
Everything | Isolated containers and VMs only |
In auto mode “a second model, the classifier, reviews actions instead of you” (source: Anthropic: Choose a permission mode), and it is now “the built-in starting permission mode for interactive terminal and VS Code sessions” (source: Anthropic: Choose a permission mode). A mode is not a check, though: it decides how often you are asked, not what never happens. That is a hook’s job or a rule’s. PreToolUse hooks “fire before any permission-mode check, in every permission mode” (source: Anthropic: Hooks guide), and a hook’s deny “blocks the tool even in bypassPermissions mode” (source: Anthropic: Hooks guide), as “deny rules block in every mode, including bypassPermissions” (source: Anthropic: Choose a permission mode).