Agent SDK reference - TypeScript changedagent-sdk/typescript
Nearest release: v2.1.330, 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 21 Nov 2026 00:16 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 21 Nov 2026 00:37 UTC.
Upstream edited
Recorded here
Lines+12added
Lines−8removed
From line
2,246
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits147to this page, all time
The whole hunk
from line 2246, old and new numbered
/
This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.
from line 2246
22462246};
22472247```
22482248
2249A warning whose `tag` is `settings_not_in_effect` means some settings from your app, or from a user, project, or local file, didn't load or were skipped. Follow the steps in `content`. You won't see this warning for every invalid value. Requires TypeScript Agent SDK v0.3.330 or later.
2250
22492251### `SDKWorkerShuttingDownMessage`
22502252
22512253Emitted on graceful worker teardown so remote clients can show why the worker exited instead of waiting for heartbeat timeout. The `reason` is a short snake\_case string set by the host CLI, such as `"host_exit"` or `"remote_control_disabled"`. Act on this only when streaming live. A resumed session replays past instances of this message, so ignore them in that case.
from line 2504
25022504 }
25032505 | {
25042506 kind: "task-notification";
2505 subkind?: "scheduled-trigger" | "peer-send-message";
2507 subkind?: "scheduled-trigger" | "peer-send-message" | "external-event";
25062508 fireReason?: string;
25072509 runId?: string;
25082510 }
from line 2534
25322534
25332535### Task-notification subkinds
25342536
2535When Claude Code delivers a task notification into a session, it sets `subkind` on the notification's `origin` if Anthropic servers verified where that notification came from. It also sets `subkind` when your application [declares the message as a scheduled run](#declare-a-scheduled-run) itself, which requires TypeScript Agent SDK v0.3.280 or later. `subkind` requires Claude Code v2.1.213 or later, and it takes one of two values:
2537When Claude Code delivers a task notification into a session, it sets `subkind` on the notification's `origin` if Anthropic servers verified where that notification came from. It also sets `subkind` when your application [declares the message as a scheduled run](#declare-a-scheduled-run) itself, which requires TypeScript Agent SDK v0.3.280 or later. `subkind` requires Claude Code v2.1.213 or later. Values include:
25362538
25372539* `scheduled-trigger`: the notification is a [cloud scheduled task](https://code.claude.com/docs/en/routines.md)'s stored prompt, delivered because one of the task's triggers fired: its schedule, its [API trigger](https://code.claude.com/docs/en/routines.md#add-an-api-trigger), its [GitHub trigger](https://code.claude.com/docs/en/routines.md#add-a-github-trigger), or **Run now**. A prompt your application [declares as a scheduled run](#declare-a-scheduled-run) carries this value too. Claude Code frames these to the model as the session's assigned task, with a different notice from the [notice that other task notifications carry](#sdktasknotificationmessage).
25382540* `peer-send-message`: the notification is a message that another of your sessions sent with the server-side `send_message` tool that [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) use to message each other, not the [cross-session `SendMessage` tool](https://code.claude.com/docs/en/cross-session-messaging), and Anthropic servers verified that both sessions belong to the same private group of sessions. Requires Claude Code v2.1.224 or later. A `send_message` delivery the servers didn't verify that way gets no subkind.
2541* `external-event`: the notification reports an event outside the session and can quote a third party. [PR activity](https://code.claude.com/docs/en/claude-code-on-the-web.md#how-claude-responds-to-pr-activity) can arrive with this value or no `subkind`. Requires Claude Code v2.1.330 or later.
25392542
2540Every other task notification has no `subkind`. That includes [PR activity](https://code.claude.com/docs/en/claude-code-on-the-web.md#how-claude-responds-to-pr-activity) delivered into a session and background events such as a finished task. Messages from the [cross-session `SendMessage` tool](https://code.claude.com/docs/en/cross-session-messaging) aren't task notifications at all: whether they come from a session on the same machine or through Anthropic servers from another machine, Claude Code gives them `kind: "peer"` and the [peer origin fields](#peer-origin-fields).
2543Background events such as a finished task have no `subkind`. Messages from the [cross-session `SendMessage` tool](https://code.claude.com/docs/en/cross-session-messaging) aren't task notifications and carry `kind: "peer"` with the [peer origin fields](#peer-origin-fields).
25412544
25422545`fireReason` says why a `scheduled-trigger` notification fired, as a short lowercase token such as `scheduled`, `manual`, `retry`, `catch_up`, or `api`. Anthropic servers set it on a [cloud scheduled task](https://code.claude.com/docs/en/routines.md)'s deliveries, and your application sets it when it declares a scheduled run. It's absent when neither sent one. Requires TypeScript Agent SDK v0.3.280 or later.
25432546
from line 4697
46944697 planWasEdited?: boolean;
46954698 awaitingLeaderApproval?: boolean;
46964699 requestId?: string;
4697};
4698```
4699
4700Returns the plan state after exiting plan mode.
4701
4702### ListMcpResources
4703
4704**Tool name:** `ListMcpResourcesTool`
4705
4706```typescript theme={null}
4707type ListMcpResourcesOutput = Array<{
4708 uri: string;
4709 name: string;
4710 mimeType?: string;
4711 description?: string;
4712 server: string;
4713}>;
4714
4700}
No line in this hunk matches that.