Agent SDK reference - TypeScript changedagent-sdk/typescript
Nearest release: v2.1.317, published 2 hours after 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 Nov 2026 21:52 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 Nov 2026 22:07 UTC.
Upstream edited
Recorded here
Lines+10added
Lines−2removed
From line
48
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits128to this page, all time
The whole hunk
from line 48, 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 48
4848
4949If your application bundles the Agent SDK together with its own dependencies, import from `@anthropic-ai/claude-agent-sdk/core` instead of the package root. The `/core` entry requires TypeScript Agent SDK v0.3.282 or later, and its types require TypeScript 5.0 or later.
5050
51The `/core` entry exports the same `query()`, `startup()`, `tool()`, `createSdkMcpServer()`, and `resolveSettings()` as the root entry, along with the functions that rename, tag, and delete sessions, `AbortError`, the runtime constants, and every type. It adds no names of its own. To keep the code your application loads small, `/core` leaves out some root exports, including `prewarm()`, the `InMemorySessionStore` class, and the helpers that list, read, fork, import, and summarize sessions. If you need one of them, use the root entry instead.
51To keep the code your application loads small, the `/core` entry leaves out some root exports:
5252
53* **Exported**: the same `query()`, `startup()`, [`prewarm()`](#prewarm), `tool()`, `createSdkMcpServer()`, and `resolveSettings()` as the root entry, along with the functions that rename, tag, and delete sessions, `AbortError`, the runtime constants, and every type. Importing the alpha `prewarm()` from `/core` requires Agent SDK v0.3.314 or later.
54* **Left out**: root exports including the `InMemorySessionStore` class and the helpers that list, read, fork, import, and summarize sessions. If you need one of them, use the root entry instead.
55
5356The root entry inlines its own copies of `zod` and `@modelcontextprotocol/sdk`. The `/core` entry imports them from your `node_modules` at the ranges the Agent SDK's `peerDependencies` declare, so a bundle that already includes them doesn't carry a second copy. Import from either the root or `/core` in a given process, not both: they are separate bundles, and loading both gives you two copies of the Agent SDK's classes and state.
5457
5558## Functions
from line 2001
19982001
19992002* A resume that Claude Code stops because it [can't return the session to its worktree](https://code.claude.com/docs/en/worktrees.md#the-session-resumes-outside-its-worktree), with `worktree_unverified` or `worktree_resume_refused`. That section says which error carries which value.
20002003* A refused [`continue`](#options) of a conversation that a background session holds, with `session_held_by_background`. For a refused [`resume`](#options) of such a conversation, Claude Code writes the result only when the variable is set.
2004* A start that Claude Code refuses because [`failIfUnavailable`](#sandboxsettings) is on and the sandbox can't start, with `sandbox_required_unavailable`.
20012005
2006The `SDKStartupFailureReason` type lists the values `startup_failure_reason` can hold:
2007
20022008```typescript theme={null}
20032009type SDKStartupFailureReason =
20042010 | "org_pin_api_key_conflict"
from line 2025
20192025 | "cli_version_too_old"
20202026 | "bypass_root"
20212027 | "org_config_required_unavailable"
2022 | "org_config_refused";
2028 | "org_config_refused"
2029 | "sandbox_required_unavailable";
20232030```
20242031
20252032Each value names one refusal:
from line 2052
20452052| `bypass_root` | Bypass permissions mode was requested while running as root |
20462053| `org_config_required_unavailable` | The session needs the organization's policies and managed settings before it can start, and they couldn't be loaded, for example because of a network failure or an Anthropic server error. Requires Agent SDK v0.3.293 or later |
20472054| `org_config_refused` | Anthropic refused to provide the organization's policies and managed settings for this sign-in, for example because the sign-in expired or was revoked, or the organization doesn't allow Claude Code for this account. Requires Agent SDK v0.3.293 or later |
2055| `sandbox_required_unavailable` | [`failIfUnavailable`](#sandboxsettings) is on and the sandbox can't start. The text in `errors` ends with `Set sandbox.failIfUnavailable=false to allow unsandboxed execution.` Requires Agent SDK v0.3.314 or later |
20482056
20492057### `SDKSystemMessage`
20502058
from line 4801
47934801
47944802**Tool name:** `ReportFindings`
47954803
4796```typescript theme={null}
4797type ReportFindingsOutput = {
4798 count: number;
4799 level?: "low" | "medium" | "high" | "xhigh" | "max";
4800 findings: Array<{
4801 file: string;
4802 line?: number;
4803 summary: string;
4804 failure_scenario: string;
4805 short_summary?: string;
4806 category?: string;
4807 verdict?: "CONFIRMED" | "PLAUSIBLE";
4808 outcome?: "fixed" | "skipped" | "no_change_needed";
4809 }>;
4810};
4811```
4812
4813Returns the number of findings reported, the `level` value Claude passed, and the findings echoed back for the result body. Requires Claude Code v2.1.196 or later. The echoed `short_summary` field requires Claude Code v2.1.212
4804``
No line in this hunk matches that.