Pimp My IDE / garage dispatchBack to the garage
October 9, 2026 / agent hooks / failure policy

The guard died. Did the action pass?

A hook is not a brake until startup failure, timeout, malformed output, and exit status each have a written outcome.

Test the broken guard, not only the rule it was meant to enforce.
Pre-action lineFailure brake
Policy hook
may fail
Agent action
must wait
A clean denial proves the rule. A dead process proves the brake.

A policy error is a policy decision.

Claude Code 2.1.295 added onFailure: "block" for command and HTTP hooks. The release note says the action is blocked when the hook cannot start, times out, or exits with an unexpected code.[1]

That setting closes a gap between a guard saying "deny" and a guard failing to answer. Those states need different records. A denial means the policy ran and rejected the action. A timeout means the policy result is unknown.

Silence from the guard is not permission.

Exit codes are part of the contract.

The current hook reference says exit code 2 is the blocking signal for most events that can block. Exit code 1 is normally a non-blocking error when there is no valid JSON decision, even though Unix tools often use 1 for failure.[2]

Do not treat every nonzero code as equivalent. Write down which code means deny, which codes mean the checker broke, and how malformed JSON is handled. Include stderr in the receipt, but do not confuse an error message with an enforced stop.

Put failure cases in the fixture.

Anthropic describes hooks as deterministic controls that run at named points in the session lifecycle. The guide lists command validation, protected-file checks, notifications, and project-rule enforcement as hook jobs.[3]

A useful fixture covers more than one expected denial. Make the hook return allow, return a documented block, crash before output, exceed its time budget, and emit invalid output. Assert both sides of each case: whether the action ran and what the operator saw.

Keep the outer boundary.

A hook runs inside a larger execution system. OpenAI's Codex 0.162.0 notes include fixes for multiple denied files, writable sandbox-construction executables, and ripgrep configuration that could weaken deny globs.[4] Those fixes concern a different tool, but they carry the same engineering lesson: policy text and enforcement code can drift.

Use hooks for a fast, visible decision. Keep file permissions, sandbox policy, credentials, network rules, and human approval outside the hook. Then test the hook and the outer boundary separately. One broken checker should not open every route.

Interactive makeover / green-path hook test replaced

Break the guard on purpose.

This browser-local bench joins a simulated hook result, failure posture, physical route, and copyable test card. It does not run Claude Code, Codex, a hook, or an agent action.

TriggerObserveDecideAssert

Simulated hook result

Choose the result your fixture will force. The control models expected policy. It does not verify product behavior.

Choose a simulated hook result

Expected failure posture

Choose expected failure posture
Test card / simulated policy only

Brake line

ALLOW
valid result
ACTION
PROCEEDS
Expected route open
Action expected to proceedThe simulated hook returned a valid allow result.
Sources read / October 9, 2026

Source log

Open the evidence boundary
  1. Anthropic, Claude Code v2.1.295 release notes, published October 8, 2026. This is the source for onFailure: "block" on command and HTTP hooks and its stated startup, timeout, and unexpected-exit behavior.
  2. Anthropic, "Hooks reference", read October 9, 2026. This is the source for exit code 2 blocking behavior, the usual non-blocking treatment of exit code 1 without a valid JSON decision, timeout fields, and event-specific exceptions.
  3. Anthropic, "Automate actions with hooks", read October 9, 2026. This is the source for the documented hook lifecycle, deterministic-control framing, and example enforcement jobs.
  4. OpenAI, Codex 0.162.0 release notes, published October 8, 2026. This is the source for the listed sandbox fixes involving denied files, writable construction executables, and deny-glob protection.

Artifact boundary: we read the current release notes and documentation. We did not install either release, run a real hook, test a sandbox, or inspect a production policy. The brake test produces a test specification, not runtime evidence.