{"version":"2.1.267","anchor":"function-hook-execution-now-supports-a-per-hook-catch-handl","canonical_anchor":"function-hook-execution-now-supports-a-per-hook-catch-handl","heading":"Function-hook execution now supports a per-hook .catch handler and 'fail closed' recovery","tier":"use","area":"Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.267\/e\/function-hook-execution-now-supports-a-per-hook-catch-handl","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.267","markdown":"### Function-hook execution now supports a per-hook .catch handler and 'fail closed' recovery\n\nHooks can now supply a .catch handler to recover instead of failing closed\n\n**What**\n\nWhen 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.\n\n**Why**\n\nThis 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.\n\n- Area: Hooks\n- Names: `.catch`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5"}