{"name":"onFailure","slug":"onfailure","family":"setting","title":"Settings keys","noun":"settings key","description":"Claude Code now flags policy helpers that require success but have no fallback settings","description_source":"entry","described_by":{"version":"2.1.265","anchor":"policyhelpers-per-entry-onfailure-and-retries-settings-now-v"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.322","builds":0,"mined_builds":161,"first_cited":{"version":"2.1.265","released_at":"2026-09-08 19:05:16","spans":6}},"aliases":[],"entries":[{"version":"2.1.317","anchor":"hook-callbacks-can-block-via-onfailure-initialize-reply-adv","heading":"SDK hooks set to block on failure now stop the action","line":"Claude Code now tells SDK programs it honors onFailure on hooks, and a hook set to block keeps waiting for its own host on remote connections","released_at":"2026-11-02 23:57:53","reason":"found in this entry's text, named in this entry"},{"version":"2.1.317","anchor":"stoppermission-hook-callbacks-gain-onfailure","heading":"SDK hooks can now block when they fail with onFailure","line":"SDK hook callbacks take an `onFailure` option: `continue` by default, or `block` to treat a failed callback as a block","released_at":"2026-11-02 23:57:53","reason":"found in this entry's text, named in this entry"},{"version":"2.1.317","anchor":"hook-callback-failure-policy-hookonfailure-block-added","heading":"Agent SDK hook callbacks can now be set to stop work when they fail","line":"In block mode, a failed SDK hook callback now raises an error instead of being quietly ignored","released_at":"2026-11-02 23:57:53","reason":"named in this entry"},{"version":"2.1.317","anchor":"hook-matchers-accept-onfailure-continueblock","heading":"SDK hosts can choose whether a failing hook lets work continue","line":"Hook matchers set by an SDK host accept onFailure as \"continue\" or \"block\"; any other value is treated as \"block\" with a warning","released_at":"2026-11-02 23:57:53","reason":"found in this entry's text, named in this entry"},{"version":"2.1.317","anchor":"sdk-hooks-with-onfailureblock-hold-the-prompt-until-init","heading":"SDK holds your prompt until hooks set to block on failure are confirmed","line":"In the SDK, a hook set to onFailure \"block\" now holds the prompt until Claude Code confirms it will honour that setting, and errors if it cannot","released_at":"2026-11-02 23:57:53","reason":"found in this entry's text, named in this entry"},{"version":"2.1.317","anchor":"async-hook-plain-stdout-can-become-sessionstart-context","heading":"Plain output from some background hooks can now become start-of-session context","line":"Some background hooks that print plain text and succeed now have that text passed to Claude as context when a session starts","released_at":"2026-11-02 23:57:53","reason":"found in this entry's text"},{"version":"2.1.317","anchor":"callback-hooks-can-now-block-on-failure","heading":"Callback hooks can now block an action when they fail","line":"Callback hooks set with `onFailure` to `block` now block when they fail, as HTTP hooks already did","released_at":"2026-11-02 23:57:53","reason":"found in this entry's text, named in this entry"},{"version":"2.1.311","anchor":"hook-cloud-sync-accepts-non-command-hook-types","heading":"Hook fingerprinting no longer skips hooks that are not command hooks","line":"A step that builds an identifying fingerprint for each hook no longer skips every hook whose type is not command","released_at":"2026-10-26 19:47:57","reason":"found in this entry's text"},{"version":"2.1.310","anchor":"powershell-hook-predicate-and-signed-answer-verification-add","heading":"Changes to PowerShell hook handling and a check for signed answers","line":"Claude Code now picks out certain blocking PowerShell hooks and can check whether an answer carries a valid digital signature","released_at":"2026-10-23 21:20:46","reason":"found in this entry's text"},{"version":"2.1.309","anchor":"hook-failure-blocking-message-now-distinguishes-powershell-h","heading":"Hook messages give specific fixes when Git Bash is missing","line":"When a hook blocks because Git Bash wasn't found, the message now gives PowerShell hooks and other hooks their own fix","released_at":"2026-10-22 20:34:13","reason":"found in this entry's text"}],"entries_total":20,"docs":[{"source":"claude-code","path":"agent-sdk\/hooks","title":"Intercept and control agent behavior with hooks","documented":false},{"source":"claude-code","path":"agent-sdk\/typescript","title":"Agent SDK reference - TypeScript","documented":false},{"source":"claude-code","path":"best-practices","title":"Best practices for Claude Code","documented":false},{"source":"claude-code","path":"changelog","title":"Claude Code changelog","documented":false},{"source":"claude-code","path":"hooks","title":"Hooks reference","documented":false},{"source":"claude-code","path":"hooks-guide","title":"Automate actions with hooks","documented":false},{"source":"claude-docs","path":"cowork\/changelog","title":"Changelog","documented":false},{"source":"claude-docs","path":"third-party\/claude-desktop\/extensions","title":"MCP, plugins, skills, and hooks","documented":false}],"docs_total":8,"gates":[],"related":[],"url":"https:\/\/changelogs.core-directive.com\/reference\/setting\/onfailure","family_url":"https:\/\/changelogs.core-directive.com\/reference\/setting.json"}