Agent SDK reference - Python changedagent-sdk/python
Nearest release: v2.1.288, published 11 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 Oct 2026 05:33 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 Oct 2026 05:37 UTC.
Upstream edited
Recorded here
Lines+2added
Lines−2removed
From line
2,019
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits85to this page, all time
The whole hunk
from line 2019, old and new numbered
/
from line 2019
20192019 "PreToolUse", # Called before tool execution
20202020 "PostToolUse", # Called after tool execution
20212021 "PostToolUseFailure", # Called when a tool execution fails
2022 "UserPromptSubmit", # Called when user submits a prompt
2022 "UserPromptSubmit", # Called when a prompt is submitted
20232023 "Stop", # Called when stopping execution
20242024 "SubagentStop", # Called when a subagent stops
20252025 "PreCompact", # Called before message compaction
from line 2203
22032203| Field | Type | Description |
22042204| :- | :- | :- |
22052205| `hook_event_name` | `Literal["UserPromptSubmit"]` | Always "UserPromptSubmit" |
2206| `prompt` | `str` | The user's submitted prompt |
2206| `prompt` | `str` | The submitted prompt |
22072207
22082208### `StopHookInput`
22092209
No line in this hunk matches that.