When a hook (custom code that runs at specific points in Claude Code) throws an error or times out, the dispatch system now checks whether the hook supplied its own .catch handler. If it did, a new recovery path runs that handler and can use the answer it returns as the hook's final result, rather than simply failing. This is logged as "hook failed closed: ... (its .catch answered)" and reported through telemetry with a reason and a flag for whether the hook overran its time limit. A new "caught" outcome is now recorded for hooks handled this way.
This lets hook authors define custom recovery behavior for failures or timeouts instead of the hook simply failing closed, giving more control over how errors in custom hooks are handled.
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.
* `gatingHooks`: whether each [mod](/docs/en/plugins/mods/overview) hook that can refuse an action, such as a `tool.call` hook, has a [`.catch` handler](/docs/en/plugins/mods/events#handle-a-hook-that-fails). Each item gives `module`, `pat…plugins/cli-reference see the edit
if (document.fullscreenElement) document.exitFullscreen(); else rootRef.current.requestFullscreen().catch(() => {});skills/how-to see the edit
Anthropic's documentation has since written up .catch, on Create custom skills.