Agent SDK reference - Python changedagent-sdk/python
Nearest release: v2.1.322, published 15 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 10 Nov 2026 17:24 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 10 Nov 2026 17:37 UTC.
Upstream edited
Recorded here
Lines+2added
Lines−2removed
From line
1,854
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits74to this page, all time
The whole hunk
from line 1854, old and new numbered
/
from line 1854
18541854
18551855### `TaskStartedMessage`
18561856
1857Emitted when a background task starts. A background task is anything tracked outside the main turn: a backgrounded Bash command, a [Monitor](#monitor) watch, a subagent spawned via the Agent tool, or a remote agent. The `task_type` field tells you which. This naming is unrelated to the `Task`-to-`Agent` tool rename.
1857Emitted when a background task starts. A background task is anything tracked outside the main turn, such as a backgrounded Bash command, a [Monitor](#monitor) watch, a subagent spawned via the Agent tool, or a remote agent. This naming is unrelated to the `Task`-to-`Agent` tool rename.
18581858
18591859```python theme={null}
18601860@dataclass
from line 1874
18741874| `uuid` | `str` | Unique message identifier |
18751875| `session_id` | `str` | Session identifier |
18761876| `tool_use_id` | `str \| None` | Associated tool use ID |
1877| `task_type` | `str \| None` | Which kind of background task: `"local_bash"` for background Bash and Monitor watches, `"local_agent"`, or `"remote_agent"` |
1877| `task_type` | `str \| None` | Which kind of background task, such as `"local_bash"` for background Bash and Monitor watches, `"local_agent"` for subagents, `"mcp_task"` for [background MCP tool calls](https://code.claude.com/docs/en/mcp.md#automatic-backgrounding-of-long-tool-calls), or `"remote_agent"` |
18781878
18791879### `TaskUsage`
18801880
No line in this hunk matches that.