Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.295 ·

Hooks can be set to block when they fail

Command and http hooks accept a new onFailure field, and setting it to "block" makes a failing hook block the action

Use it now Notable New Features
JSON All of v2.1.295
Use it nowTier: how much it should matter to you
5Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
HooksArea: what it touches
New FeaturesKind: in v2.1.295,
What probably matters to youSection of the release
What

Hooks are your own commands or web requests that Claude Code runs at set moments, for example before a tool runs. Command hooks and http hooks now accept an onFailure field. Set it to "block" and a failure of that hook is treated as blocking, so the action it guards does not go ahead.

This does not apply to command hooks set to run in the background with async or asyncRewake. When a hook blocks this way, the reason given is blocking because onFailure is "block".

Why

By default a failing hook does not stop anything. A hook that enforces a rule can now fail closed, so a crash or error in the hook stops the action instead of letting it through unchecked.

Read from
Names in the bundleonFailure
Since it was published

The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.

Added since A small documentation edit on Agent SDK reference - TypeScript touched a line naming onFailure after this was published. onFailure?: "continue" | "block"; // "block" blocks the action when a callback fails agent-sdk/typescript see the edit
Confirmed since Anthropic's documentation has since written up onFailure, on Hooks reference. | `onFailure` | no | What happens to the action when the hook fails: `"continue"`, the default, or `"block"`. See [Block the action when a hook fails](#block-the-action-when-a-hook-fails). Requires Claude Code v2.1.295 or later | hooks see the edit
How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up onFailure, on Hooks reference.

See this entry in the whole of v2.1.295 →

Feedback