Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Automate actions with hooks changedhooks-guide

Nearest release: v2.1.335, published 8 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Upstream edited this page at 3 Dec 2026 06:09 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 3 Dec 2026 06:37 UTC.

Upstream edited
Recorded here
Lines+3added
Lines−3removed
From line 989 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits67to this page, all time

The whole hunk

from line 989, old and new numbered
/
lines
from line 989
989989 
990990### Hook error in output
991991 
992You see a message like "PreToolUse hook error: ..." in the transcript.
992You see a message such as `PreToolUse:Bash hook failed` or `PreToolUse:Bash hook error: ...` in the transcript.
993993 
994994* Your script exited with a non-zero code unexpectedly. Test it manually by piping sample JSON:
995995 ```bash theme={null}
from line 1065
10651065 
10661066Press `Ctrl+O` to open the transcript view and look for the hook's outcome:
10671067 
1068* **Success**: you see nothing, unless the hook's JSON surfaces something, such as `systemMessage` or Stop hook feedback.
1068* **Success**: look for any `systemMessage` text from your hook on [events that show it](https://code.claude.com/docs/en/hooks.md#json-output). For a `Stop` hook's `additionalContext` field, look for a `Stop hook says` line.
10691069 * To confirm the hook ran, check for its effect, like a reformatted file
10701070* **Blocking error**: on most events you see the message that came with the block, for example `Blocked: rm commands are not allowed`. On a few events, such as `ConfigChange` and `Elicitation`, you see no message. [Exit code 2](https://code.claude.com/docs/en/hooks.md#exit-code-2) covers where the message comes from.
1071* **Non-blocking error**: a `<hook name> hook error` notice with `Failed with non-blocking status code:` means your hook didn't stop the action. You don't see this notice when a command hook on an event such as `Notification` fails.
1071* **Non-blocking error**: if you see a `PreToolUse:<tool> hook failed` notice with your hook's stderr under it, your hook didn't stop the call. On some events, such as `Notification`, you see no notice when a command hook fails.
10721072 
10731073To look up the outcome for a combination of exit code and stdout on an event such as `PreToolUse`, see [Exit code output](https://code.claude.com/docs/en/hooks.md#exit-code-output) in the reference. Check the same section for events with their own exit code rules, such as `WorktreeCreate`.
10741074 
Feedback