Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.308 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Intercept and control agent behavior with hooks changedagent-sdk/hooks

Recorded here
Lines+6added
Lines−8removed
From line 645 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits19to this page, all time

The whole hunk

from line 645, old and new numbered
/
lines
from line 645
645645 
646646### Forward notifications to Slack
647647 
648Use `Notification` hooks to receive system notifications from the agent and forward them to external services. Notifications fire for event types such as:
648Use `Notification` hooks to receive system notifications from the agent and forward them to external services. In SDK sessions, Claude Code runs this hook for the following notification types:
649649 
650* `permission_prompt` when Claude needs permission
651* `idle_prompt` when Claude is waiting for input
652* `auth_success` when authentication completes
653* `elicitation_dialog`, `elicitation_complete`, and `elicitation_response` for user-prompt elicitation flows
650* [`permission_prompt`](/docs/en/hooks#notification) once a permission request has waited about six seconds on your [`canUseTool` callback](/docs/en/agent-sdk/user-input). Requires TypeScript Agent SDK v0.3.233 or later, or Python Agent SDK v0.2.139 or later
651* `elicitation_complete` and `elicitation_response` for user-prompt elicitation flows
654652 
655In headless SDK sessions, only the elicitation events `elicitation_complete` and `elicitation_response` fire this hook; the other types are emitted by interactive UI that SDK sessions don't run. Permission requests, for example, go to the `canUseTool` callback instead.
653Claude Code emits the other types, such as `idle_prompt`, `auth_success`, and `elicitation_dialog`, from interactive UI that SDK sessions don't run.
656654 
657655Each notification includes a `message` field with a human-readable description and optionally a `title`.
658656 
Feedback