Intercept and control agent behavior with hooks changedagent-sdk/hooks
Nearest release: v2.1.334, published 5 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 2 Dec 2026 00:40 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 01:07 UTC.
Upstream edited
Recorded here
Lines+1added
Lines−1removed
From line
826
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits34to this page, all time
The whole hunk
from line 826, old and new numbered
/
from line 826
826826* `WorktreeCreate`: worktree creation fails with an error.
827827* `Notification`, `PreCompact`, and `PostModelSwitch`: Claude Code logs the failure and continues. To block compaction when a `PreCompact` callback times out, set [`onFailure: "block"`](#block-the-action-when-a-callback-fails).
828828
829The first time a `Stop` or `SessionStart` callback times out in the main session, Claude Code also adds an [`SDKInformationalMessage`](https://code.claude.com/docs/en/agent-sdk/typescript#sdkinformationalmessage) to the message stream saying the app driving the session didn't respond. Later timeouts don't repeat that message while your app stays unresponsive.
829The first time a `Stop` or `SessionStart` callback times out in the main session, your message stream also includes an [`SDKInformationalMessage`](https://code.claude.com/docs/en/agent-sdk/typescript#sdkinformationalmessage) object saying the app driving the session didn't respond. While your app stays unresponsive, at most one such message arrives per hook type.
830830
831831If you interrupt the query while a callback is pending, Claude Code cancels the pending tool call. Before v2.1.208, the tool call could still proceed if you interrupted during a pending `PreToolUse` callback.
832832
No line in this hunk matches that.