Automate actions with hooks changedhooks-guide
Nearest release: v2.1.335, published 9 hours after 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 2 Dec 2026 12:29 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 2 Dec 2026 12:37 UTC.
Upstream edited
Recorded here
Lines+1added
Lines−1removed
From line
848
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 848, old and new numbered
/
from line 848
848848 * `PostToolUse`: by default the turn ends and the `reason` appears in the chat as a warning line. Set `continueOnBlock: true` to feed the `reason` back to Claude and continue the turn instead
849849 * `PostToolBatch`, `UserPromptSubmit`, and `UserPromptExpansion`: the turn ends and the `reason` appears in the chat as a warning line
850850
851This example uses a `Stop` hook to ask the model whether all requested tasks are complete. If the model returns `"ok": false` because the condition isn't met yet, Claude keeps working and uses the `reason` as its next instruction:
851This example uses a `Stop` hook to ask the model whether all requested tasks are complete. If the model returns `"ok": false` because some requested tasks aren't complete yet, Claude receives the `reason` and keeps working:
852852
853853```json theme={null}
854854{
No line in this hunk matches that.