Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Agent SDK reference - TypeScript changedagent-sdk/typescript

Nearest release: v2.1.329, published 4 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 19 Nov 2026 23:04 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 19 Nov 2026 23:07 UTC.

Upstream edited
Recorded here
Lines+5added
Lines−2removed
From line 1,381 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 1381, old and new numbered
/
lines

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 1381
13811381 | "acceptEdits" // Auto-accept file edits
13821382 | "bypassPermissions" // Bypass permission checks; explicit ask rules still prompt
13831383 | "plan" // Planning mode - Claude explores and plans
1384 | "dontAsk" // Don't prompt for permissions, deny if not pre-approved
1384 | "dontAsk" // Deny calls that would otherwise prompt
13851385 | "auto"; // A model classifier reviews actions such as shell commands and network requests
13861386```
13871387 
from line 1898
18981898 deferred_tool_use?: { id: string; name: string; input: Record<string, unknown> };
18991899 terminal_reason?: TerminalReason;
19001900 result_index?: number;
1901 credential_expires_at?: string;
19011902 fast_mode_state?: FastModeState;
19021903 fast_mode_disabled_reason?: FastModeDisabledReason;
19031904 origin?: SDKMessageOrigin;
from line 1929
19281929 resume_reason?: string;
19291930 terminal_reason?: TerminalReason;
19301931 result_index?: number;
1932 credential_expires_at?: string;
19311933 fast_mode_state?: FastModeState;
19321934 fast_mode_disabled_reason?: FastModeDisabledReason;
19331935 origin?: SDKMessageOrigin;
from line 1954
19521954* `total_cost_usd`: cumulative estimated cost in USD, covering the same calls as `modelUsage` and reset at the same points. A call that resumes a session also counts the [totals restored from the session's earlier calls](https://code.claude.com/docs/en/agent-sdk/cost-tracking.md#accumulate-costs-across-multiple-calls). It is an estimate, not a billing statement. See [Track cost and usage](https://code.claude.com/docs/en/agent-sdk/cost-tracking.md) for accuracy caveats.
19531955* `queued_turn_count`: the number of messages you sent with `origin: { kind: "human" }` that are still waiting when Claude Code produced the result. See [`queued_turn_count`](#queued_turn_count) for what `0` and an absent field tell you.
19541956* `result_index`: where this result falls in the run's delivery order, counting from 0 across every result the process writes. Present on both arms. A result whose write fails still consumes its number, so a gap in the sequence means a result was lost. Requires Agent SDK v0.3.268 or later.
1957* `credential_expires_at`: the stored claude.ai login's latest expected end, as an ISO 8601 timestamp. The login can end up to three days earlier. Absent for other credentials or when no date is known. Requires Agent SDK v0.3.318 or later.
19551958* `startup_failure_reason`: why Claude Code refused to start, on the `error_during_execution` result it writes before exiting on a known startup failure. See [`startup_failure_reason`](#startup_failure_reason) for the values and which failures carry it. Requires Agent SDK v0.3.274 or later.
19561959* `terminal_reason`: why the loop ended. One of `"completed"`, `"max_turns"`, `"tool_deferred"`, `"aborted_streaming"`, `"aborted_tools"`, `"hook_stopped"`, `"stop_hook_prevented"`, `"background_requested"`, `"blocking_limit"`, `"rapid_refill_breaker"`, `"prompt_too_long"`, `"image_error"`, `"model_error"`, `"api_error"`, `"malformed_tool_use_exhausted"`, `"budget_exhausted"`, `"structured_output_retry_exhausted"`, `"tool_deferred_unavailable"`, or `"turn_setup_failed"`.
19571960* `fast_mode_state`: one of `"on"`, `"off"`, or `"cooldown"`.
from line 3804
38013804};
38023805```
38033806 
3804Schedules a prompt to run on a 5-field cron schedule in local time. Set `recurring` to `false` to fire once at the next match. Jobs are session-scoped by default, and resuming with `--resume` or `--continue` restores jobs that haven't expired. See [Session-scoped scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks.md).
3807Schedules a prompt to run on a 5-field cron schedule in local time. Set `recurring` to `false` to fire once at the next match. Jobs are session-scoped by default. See [Session-scoped scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks.md).
38053808 
38063809Setting `durable` to `true` requests persistence to `.claude/scheduled_tasks.json` so the job survives restarts. Durable scheduling isn't available in every session: when it isn't, Claude Code accepts `durable: true` but creates the job session-only. Read the output's `durable` field to see whether the job persisted.
38073810 
from line 4715
47124715 
47134716Returns an array of available MCP resources.
47144717 
4715### ReadMcpResource
47164718 
4717**Tool name:** `ReadMcpResourceTool`
4718 
4719```typescript theme={null}
4720type ReadMcpResourceOutput = {
4721 contents: Array<{
4722 uri: string;
4723 mimeType?: string;
4724 text?: string;
4725 blobSavedTo?: strin
Feedback