unstale

npm / @anthropic-ai/claude-agent-sdk

@anthropic-ai/claude-agent-sdk

What changed in @anthropic-ai/claude-agent-sdk 0.1 to 0.3, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

76 breaking20 security6 deprecations278 new APIs and options8 performance96 behavior and defaults1 tooling213 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

@anthropic-ai/claude-agent-sdk 0.3531 changes

Breaking changes 70

  • An inline definition in agents now takes precedence over a user, project, plugin, or built-in agent with the same name for model, prompt, and hooks.

    0.3.328release notes

  • When CLAUDE_CODE_FORK_SUBAGENT=0, subagents now wait for their own subagents by default.

    0.3.328release notes

  • For a shell command rewritten by a PermissionRequest hook, the rewrite's own permission check now determines its sandbox; a sandbox-excluded rewrite runs outside it. canUseTool is unchanged.

    0.3.328release notes

  • Hook event values and matcher hooks must be arrays; Sets, generators, plain objects, true, and numbers are refused.

    0.3.327release notes

  • JSON-RPC request IDs sent to an SDK MCP server are numbers again instead of strings.

    0.3.327release notes

  • Servers created with createSdkMcpServer() in an agent's mcpServers are ignored with a warning; move them to top-level mcpServers to give the main session their tools.

    0.3.327release notes

  • Refuses options that cannot be sent to Claude Code, such as an agent with a circular or BigInt field.

    0.3.327release notes

  • Reverted the previous fix for a tool result being lost or delivered to another call after reconnect.

    0.3.327release notes

  • Refuses options that cannot be sent to Claude Code, such as an agent with a circular or BigInt field.

    0.3.327release notes

  • The control request now refuses some folders it previously accepted.

    0.3.326release notes

  • On macOS, Linux, and WSL, rewindFiles() leaves some files untouched when the sandbox is on and reports them as skipped.

    0.3.326release notes

  • Rejects values that would make Claude Code discard its settings layer, applies nothing, and keeps settings from earlier calls.

    0.3.325release notes

  • Read-only git commands in repositories outside the working directory, additional directories, or trusted directories now go through the permission flow instead of being auto-approved.

    0.3.325release notes

  • Sandboxed Bash commands are no longer auto-approved unless autoAllowBashIfSandboxed: true is set.

    0.3.325release notes

  • When a tool permission check errors after a PreToolUse hook allows the call, the error is sent to canUseTool or the call is refused if there is no callback.

    0.3.323release notes

  • Also lists load errors for plugins enabled by managed settings; checks may run before background installation ends, while CLAUDE_CODE_SYNC_PLUGIN_INSTALL=1 waits.

    0.3.323release notes

  • In auto mode, queued reports share one model call; each keeps its own message and result, and all but the last end with an empty result and num_turns: 0.

    0.3.321release notes

  • deleteSession() rejects with ENOTEMPTY if it cannot fully delete the session folder.

    0.3.319release notes

  • This is sent only when the CLI exits 0; runs ending on an error result receive only the stderr line.

    0.3.319release notes

  • Removes the file_unchanged variant; a repeated Read now returns the file content.

    0.3.317release notes

  • The minimum supported Node.js version changes from 18.0.0 to 18.14.0.

    0.3.311release notes

  • An omitted permissionMode now starts in default mode on third-party providers, with telemetry off or on a fresh install; pass permissionMode: 'auto' to keep auto mode.

    0.3.302release notes

  • When the API refuses a response, the result is now an error with no payload instead of delivering the response output as structured_output.

    0.3.302release notes

  • When a full disk prevents login refresh, api_error_status is now null instead of 401.

    0.3.301release notes

  • When a full disk prevents login refresh, the error is now invalid_request instead of authentication_failed.

    0.3.301release notes

  • Connector tools that an organization set to require approval no longer receive this option as true.

    0.3.300release notes

  • Values from PreToolUse and PermissionRequest hook callbacks are validated like Claude's own input, and unknown keys are dropped; canUseTool is unchanged.

    0.3.300release notes

  • When a user message merges several queued peer messages, origin.body is omitted instead of containing only the first message's text.

    0.3.299release notes

  • initialize, mcp_set_servers, and claim_session now refuse the reserved MCP server names __proto__, __defineGetter__, __defineSetter__, __lookupGetter__, and __lookupSetter__.

    0.3.299release notes

  • For permission answers received after a restart, lists with over 4,096 updatedPermissions entries count as a denial.

    0.3.296release notes

  • For MCP Apps tools, _meta over 8,388,608 JSON characters is left off tool_use_result.

    0.3.295release notes

  • _meta.ui with no ui:// resource no longer lifts the ordinary caps for MCP Apps tool results.

    0.3.295release notes

  • For MCP tools, result _meta over 1,048,576 JSON characters is left off, except for SDK-server tools.

    0.3.295release notes

  • User-message pasted_content is ignored when it contains more than 1,000 entries and blocks in total.

    0.3.295release notes

  • For MCP Apps tools, structuredContent over 8,388,608 JSON characters is left off tool_use_result.

    0.3.295release notes

  • Text blocks' _meta is left off when it totals over 65,536 characters.

    0.3.295release notes

  • This field is absent when a mod withheld the result of a tool that ran without error; it was previously permission-rule.

    0.3.295release notes

  • A permission answer with more than 4,096 updates, rules, and directories now counts as a denial.

    0.3.295release notes

  • For a finishing background task, this event now arrives after task_updated and task_notification.

    0.3.292release notes

  • For WebFetch or WebSearch calls that yield to a priority "now" message, the result is { detachedToolCall: true } and follows in a later turn.

    0.3.287release notes

  • For MCP tools, structuredContent over 1,048,576 JSON characters is omitted and structuredContentOmitted: true is set, except for SDK-server and MCP Apps tools.

    0.3.287release notes

  • When permissionMode is omitted, Claude Code settings defaultMode now applies; on third-party providers or with telemetry off, sessions start in auto mode. Pass permissionMode: 'default' for manual approvals.

    0.3.286release notes

  • Now returns messages a subagent read while running, such as messages sent to it; offset and limit count those rows.

    0.3.285release notes

  • Bash and PowerShell timeout now bounds run_in_background commands; its default is 30 minutes and its maximum is 2 hours, and the stopped task notification explains when that limit stops a task.

    0.3.285release notes

  • Changing the effort level without ultracode turns Ultracode off.

    0.3.284release notes

  • The first turn still waits up to 2 seconds for connecting MCP servers named in allowedTools or by an mcp_tool hook, even when this variable is set to 0.

    0.3.284release notes

  • Drops content _meta keys under the CLI-reserved com.anthropic/ prefix when relaying resource results, matching tool-result behavior.

    0.3.282release notes

  • The attribution field's type is now boolean | {...}; TypeScript code reading attribution.commit from returned settings needs a type narrow.

    0.3.281release notes

  • Headless sessions cancel an MCP server's pending form question when the tool call that drew it ends.

    0.3.280release notes

  • Queued completions now share one model call; each still gets its own result, with all but the last empty and num_turns: 0.

    0.3.274release notes

  • Removes persistent from the MonitorInput tool type.

    0.3.271release notes

  • In plan mode, writes now go through canUseTool even when allowDangerouslySkipPermissions is set; the flag only enables switching to bypassPermissions later.

    0.3.269release notes

  • TaskCreate/Get/Update/List and TodoWrite are default tools only on the listed Claude and model versions; elsewhere, list them in tools or allowedTools.

    0.3.268release notes

  • Reports failure when no files could be restored, such as when checkpoint backups are missing, instead of reporting success.

    0.3.260release notes

  • total_cost_usd and modelUsage.costUSD now include the 1.1× US-only-inference multiplier when the response reports inference_geo: "us".

    0.3.239release notes

  • Push events now emit one event per pushed branch.

    0.3.238release notes

  • Removed the unused bypass_permissions_disabled value; TypeScript consumers with an explicit case branch get a compile error on upgrade, with no runtime effect.

    0.3.234release notes

  • Todo/task-tracking tools are no longer in the default tool surface on Opus 4.8, Sonnet 5, Fable 5, Mythos 5, and newer models; name them in tools or allowedTools, or set CLAUDE_CODE_ENABLE_TODO_TOOLS=1, to keep them.

    0.3.233release notes

  • Subagent MCP tool_result frames with _meta now emit tool_use_result as { content, _meta }, matching main-loop frames.

    0.3.232release notes

  • Conversations whose messages alone exceed the API's 32 MB limit now end with terminal_reason "api_error" instead of "image_error"; StopFailure error_details is "request_body_over_limit: …".

    0.3.229release notes

  • Malformed and wildcard-form skill names are rejected with a clear error; use skills: 'all' to enable every skill.

    0.3.221release notes

  • Subagents no longer spawn nested subagents by default; the depth cap is lowered from 5 to 1. Set CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH to allow deeper nesting.

    0.3.217release notes

  • Unrecognized permission modes now produce an error instead of being silently adopted; the 'manual' alias is accepted at every ingress.

    0.3.214release notes

  • SessionStart hooks now report source "fork" instead of "resume" when a session begins as a fork.

    0.3.214release notes

  • Control requests now reject unrecognized model strings before latching.

    0.3.200release notes

  • On native builds, sessions now default to fast embedded find/grep search in Bash instead of registering dedicated Grep/Glob tools; name those tools in tools or allowedTools to keep them.

    0.3.162release notes

  • MCP servers connect in the background by default, so sessions start immediately and slow servers report status: "pending" in init until ready. Set MCP_CONNECTION_NONBLOCKING=0 to restore waiting, or mark a server alwaysLoad: true to require it in turn 1.

    0.3.142release notes

  • Headless --sdk-url sessions now exit non-zero with a stderr diagnostic when the remote transport closes permanently, instead of silently exiting 0.

    0.3.142release notes

  • Headless and SDK sessions use Task tools instead of TodoWrite; tool consumers should accumulate tasks by task ID instead of replacing a snapshot list.

    0.3.142release notes

  • The v2 session API was removed. Use query() with an AsyncIterable<SDKUserMessage> for multi-turn sessions or options.resume to continue a session.

    0.3.142release notes

Security 19

  • Secrets are now masked more effectively in the description passed to canUseTool; input itself is unchanged.

    0.3.326release notes

  • Deny rules naming or glob-matching an in-process SDK MCP tool or its server now remove it from Claude's tool list and system/init.

    0.3.325release notes

  • Suggestions no longer include Bash allow rules for commands writing to sensitive paths when those rules would not stop the next request.

    0.3.323release notes

  • The SDK MCP server follows the organization's Claude in Chrome policy and is not connected where policy denies it.

    0.3.321release notes

  • Fixes settings files excluded from settingSources still supplying some settings, including auto mode rules and saved permission consents.

    0.3.314release notes

  • Host-supplied managedSettings now retains disableAllHooks, disableSkillShellExecution, and empty allowedHttpHookUrls and httpHookAllowedEnvVars lists.

    0.3.309release notes

  • Deny and ask rules now match aliased tools with wildcard and match-all patterns, including when an input field is also in disallowedTools.

    0.3.290release notes

  • A hook callback returning { decision: 'block' } now declines the MCP elicitation.

    0.3.284release notes

  • canUseTool options now include MCP server name and source, allowing hosts to key trust on the source.

    0.3.274release notes

  • Added a setting that holds cross-session messages sent to a session running with bypassed permissions for approval; messages to other sessions auto-deliver.

    0.3.224release notes

  • Fixed long project paths resolving to another project's session directory under a shared sanitized prefix; session operations and /resume no longer cross projects.

    0.3.224release notes

  • Added awsPairs for sandbox credential masking associated with AWS SigV4 re-signing.

    0.3.224release notes

  • Added extract to envVars as part of sandbox credential-masking configuration.

    0.3.224release notes

  • Added maskClaims for sandbox credential masking alongside JWT decoding.

    0.3.224release notes

  • Added onExtractNoMatch to envVars as part of sandbox credential-masking configuration.

    0.3.224release notes

  • Adds an SDK settings option for deterministically denying non-allowlisted hosts in sandboxed commands.

    0.3.219release notes

  • Maps isSynthetic to isMeta on ingestion so synthetic messages are not treated as real user messages.

    0.3.198release notes

  • Adds a setting for configuring credential file and environment variable denial in sandboxed commands.

    0.3.187release notes

  • MCP server-level specs mcp__server and mcp__server__* now correctly remove all tools from the named server instead of being silently ignored.

    0.3.178release notes

Deprecations 2

  • Sending mcpServers on Claude Code's command line is deprecated; a future release defaults to 'initialize'. Apps using older Claude Code must update it or set 'argv'.

    0.3.326release notes

  • A runtime warning is added when canUseTool is configured alongside allowedTools or bypassPermissions, which shadow the callback.

    0.3.198release notes

New APIs and options 198

  • Host-supplied managedSettings now support the policy plugin's allowManagedModsOnly option; an admin's managed settings still take precedence.

    0.3.328release notes

  • Set this environment variable in the env option to stop resume and continue from running a tool call deferred by a hook; settings cannot set it.

    0.3.328release notes

  • The Settings type adds onFailure to mcp_tool hooks; setting it to "block" makes a failed hook block the action it guards.

    0.3.328release notes

  • Added getSessionInfo() to the /core entry.

    0.3.326release notes

  • When an administrator's managed-mcp.json arrives during a session and stops your own MCP servers from loading, the SDK emits a tagged system/informational warning.

    0.3.326release notes

  • Added the 'initialize' delivery mode, which sends mcpServers in the initialize request instead of on Claude Code's command line; it requires the bundled Claude Code or newer.

    0.3.326release notes

  • cancel_async_message responses now include message_uuid to identify the dropped message.

    0.3.326release notes

  • Session objects returned by listSessions() and getSessionInfo() now include an archived field.

    0.3.325release notes

  • Adds an API to archive a session.

    0.3.325release notes

  • Adds invalid_config_file to the config_file_invalid startup failure result, with the broken config file's path and its backup's path as fields.

    0.3.325release notes

  • Adds managed_lock to plugin_errors entries on system/init, naming the managed enabledPlugins entry that dropped a plugin copy.

    0.3.325release notes

  • A skill proposal can now carry edits.

    0.3.325release notes

  • Adds refuseIfBusy so a host can have a plugin reload refused while the session is busy.

    0.3.325release notes

  • Adds an API to unarchive a session.

    0.3.325release notes

  • Adds an alpha API that identifies which models a deniedModels list blocks according to Claude Code's entry rules.

    0.3.323release notes

  • Adds machinePolicy.didNotLoad to the result, telling a host when a machine policy source may be present but did not load.

    0.3.323release notes

  • Emits periodic heartbeat notifications while a turn waits on long-running hooks; hook event and tool-use identifiers have specified values, and the parent tool-use identifier may name no tool call.

    0.3.323release notes

  • SDK sessions support background MCP tasks with streaming input when CLAUDE_AUTO_BACKGROUND_TASKS=1; the task_type is "mcp_task". Not available on Bedrock, Vertex or Foundry.

    0.3.319release notes

  • A new startup failure reason is reported when a configuration file read at startup isn't valid JSON.

    0.3.318release notes

  • Result messages can include an optional credential_expires_at field when the stored claude.ai sign-in in use ends.

    0.3.318release notes

  • readFile() UTF-8 answers include lossy: true when decoding replaced bytes that are not valid UTF-8.

    0.3.317release notes

  • Hook matchers can use onFailure: with "block", a hook that throws or returns invalid output blocks the action.

    0.3.317release notes

  • A system message is sent after the last result if a full disk or disk quota prevented saving the session transcript or ~/.claude.json.

    0.3.317release notes

  • Adds initialize_not_first for a --await-initialize launch whose first stdin line is not the initialize request.

    0.3.317release notes

  • TaskCreate's tool_use_result now includes the description the task was created with.

    0.3.317release notes

  • Adds a Settings field for paths that blockReadsOutsideWorkingDirectories lets through without making them working directories.

    0.3.316release notes

  • Adds permissions.blockWritesOutsideWorkingDirectories to the Settings type.

    0.3.314release notes

  • Adds the alpha prewarm() API to the @anthropic-ai/claude-agent-sdk/core entry point.

    0.3.314release notes

  • Adds sandbox_required_unavailable for the result Claude Code writes when a required sandbox cannot run.

    0.3.314release notes

  • Added unanswered to AskUserQuestion answers' per-question annotations, with values skipped, replied_in_chat or dismissed; send it only when system/init lists the ask_user_question_unanswered_v1 capability.

    0.3.312release notes

  • Added permissions.disableAutoMode to the Settings type.

    0.3.312release notes

  • Added autoMode to the Settings type.

    0.3.312release notes

  • Added skipAutoPermissionPrompt to the Settings type.

    0.3.312release notes

  • Added useAutoModeDuringPlan to the Settings type.

    0.3.312release notes

  • Adds a field splitting cache creation input tokens by the 1-hour cache lifetime.

    0.3.311release notes

  • Adds a field splitting cache creation input tokens by the 5-minute cache lifetime.

    0.3.311release notes

  • The started frame for a wakeup now includes scheduled_for.

    0.3.307release notes

  • The started frame for a scheduled wakeup or task now includes wakeup_source, allowing a host to tell which one fired.

    0.3.307release notes

  • Browser SDK query() accepts supportedDialogKinds and sends it on initialize; a non-empty list requires onUserDialog.

    0.3.307release notes

  • The response's behavior windows now include recommendations and fix.

    0.3.305release notes

  • Reopens a query's event stream after it was suspended, without ending the query.

    0.3.304release notes

  • Closes a query's event stream without ending the query, so it can be reopened later.

    0.3.304release notes

  • Exports the public built-in tool names for checking permission rules and tool settings.

    0.3.301release notes

  • Exports earlier built-in tool names for checking permission rules and tool settings.

    0.3.301release notes

  • Accepts addPlugins so a host can load more plugin folders into a running session.

    0.3.301release notes

  • sdk-type MCP server configs can set per-tool permission policies to always_ask or always_deny, applied on initialize and setMcpServers().

    0.3.301release notes

  • CronCreate and CronList tool outputs now optionally include the epoch millisecond time of the next run.

    0.3.299release notes

  • The elicitation control request includes form field names in MCP server order for hosts whose transport does not preserve JSON object key order.

    0.3.299release notes

  • AgentDefinition now supports setting a subagent to auto-compact earlier than the main conversation's window.

    0.3.296release notes

  • The initialize control response now includes the CLI version, so clients can know it before the first turn.

    0.3.296release notes

  • Adds overageEnabled to indicate whether the account has extra usage turned on when usage-limit warnings occur.

    0.3.295release notes

  • Task entries can optionally include a subagent type, so hosts can identify each subagent without pairing with task_started.

    0.3.293release notes

  • Assistant and user messages produced by a subagent now include its task ID, which remains stable when the subagent is resumed.

    0.3.292release notes

  • Each notification in ReadNotifications output can include when it reached the session.

    0.3.292release notes

  • Options now carry suppressAlwaysAllowRule: true for connector tools an organization requires approval for, allowing hosts to hide their always-allow choice.

    0.3.292release notes

  • The ListAgents tool result now provides typed notes so hosts can list agents without parsing its text.

    0.3.292release notes

  • Task notifications now include the run ID, letting hosts distinguish runs of a resumed task.

    0.3.292release notes

  • Task-started events and background-task entries now identify the subagent task that launched a task.

    0.3.292release notes

  • ReadNotifications output can include when the tool read the session's queued notifications.

    0.3.292release notes

  • SendMessage tool-use inputs on assistant messages now include recipient_kind, so hosts need not infer it from raw input.

    0.3.292release notes

  • Background task events now include a run ID so hosts can distinguish runs of a resumed task.

    0.3.292release notes

  • The ListAgents tool result now provides typed sections so hosts can list agents without parsing its text.

    0.3.292release notes

  • The WebFetch tool input accepts an optional offset for reading on through long pages.

    0.3.290release notes

  • The success result message can include this optional remote-session latency field.

    0.3.287release notes

  • The system/init capabilities now include sdk_mcp_manifests.

    0.3.286release notes

  • The initialize response now includes the sdk_mcp_manifests_parked field.

    0.3.286release notes

  • The system/init capabilities now include sdk_mcp_tools_list_changed.

    0.3.286release notes

  • The Artifact tool's structured read result can now include the artifact's stored title.

    0.3.285release notes

  • The Settings type now includes allowedProviders.

    0.3.285release notes

  • The startup_failure_reason type now includes provider_not_allowed.

    0.3.285release notes

  • Adds a setting that reports whether the session can run Ultracode, regardless of whether it is in effect.

    0.3.284release notes

  • Adds a setting that reports whether Ultracode is requested, independently of whether it is in effect.

    0.3.284release notes

  • The system/init message type now includes plugin_errors, with path identifying a --plugin-dir entry that did not load.

    0.3.283release notes

  • Adds a smaller entry point for apps that bundle the SDK, providing query, MCP tool helpers, session mutations, and resolveSettings; it uses the installed zod and MCP SDK.

    0.3.282release notes

  • Host-supplied managedSettings supports blockedMarketplaces, adding to the admin's blocklist.

    0.3.282release notes

  • Host-supplied managedSettings supports strictKnownMarketplaces; its allowlist applies only where admin policy sets none.

    0.3.282release notes

  • Starts a Claude Code process before its session is known so it can later be bound to a folder and per-session options.

    0.3.282release notes

  • Adds the alpha claim operation to bind a prewarmed Claude Code process to a folder and its per-session options.

    0.3.282release notes

  • Adds an optional timestamp field so clients can show when the reset happened.

    0.3.281release notes

  • Adds an optional trigger field so clients can tell what reset the conversation.

    0.3.281release notes

  • Adds an optional user_message_uuid field so clients can match a /clear to its message.

    0.3.281release notes

  • Tool entries now include MCP Apps ui metadata so a host can find the tool's ui:// resource.

    0.3.280release notes

  • This alpha API reads an MCP Apps ui:// resource from an MCP server connected by Claude Code.

    0.3.280release notes

  • Task-notification origins can include the optional fireReason field.

    0.3.280release notes

  • This option delivers prompts as written, without @path expansion or slash-command dispatch; on current CLIs, it also prevents ambient attachments with the prompt.

    0.3.280release notes

  • Success result messages can include this optional remote-session latency field.

    0.3.277release notes

  • SDKUserMessage includes pasted_content for text the user pasted rather than typed, appended after the typed prompt.

    0.3.277release notes

  • SlashCommand has an optional builtin field indicating whether a command is built into Claude Code.

    0.3.277release notes

  • Set this environment variable to 1 for stream-json hosts to emit per-phase startup timing in the session's first system/init.

    0.3.274release notes

  • Set this environment variable to bound or disable (0) the first-turn wait for connecting MCP servers.

    0.3.274release notes

  • Stream-JSON error results now include the known startup failure reason before the run exits.

    0.3.274release notes

  • The first system/init can include a per-phase startup timing breakdown for stream-json hosts.

    0.3.274release notes

  • task_notification messages now include reason: "worker_restart" when a background task was stopped by a worker process restart.

    0.3.273release notes

  • Assistant messages delivering a headless /usage result now include a usage_report sibling containing session totals, the plan's usage rows as sent by the server, and extra usage.

    0.3.273release notes

  • Adds optional omitClaudeMd so a subagent can run without user, project and local CLAUDE.md files; managed policy files still load.

    0.3.271release notes

  • This optional hint makes the prompt open on its decline option.

    0.3.268release notes

  • This optional hint makes the prompt offer no persistent "always allow" choice.

    0.3.268release notes

  • Each category in the get_context_usage control response now identifies its kind as used, free, buffer, or deferred.

    0.3.268release notes

  • A result message includes the slash command's name when a turn runs a slash command without entering the model loop.

    0.3.268release notes

  • Set holdOnCacheImpact: true to hold a plugin reload that would invalidate the session's prompt cache.

    0.3.268release notes

  • Result messages now include the result's position in delivery order within the run, starting at 0.

    0.3.268release notes

  • Assistant, stream-event, and result messages include this field only on an automatic re-run of a turn interrupted by a host restart.

    0.3.268release notes

  • Added as an SSE option.

    0.3.267release notes

  • Added to the browser SDK's SSE transport.

    0.3.267release notes

  • Synthetic turns started with isSynthetic: true and a uuid now include user_message_uuid and user_message_uuids in the first reply and result, identifying the message that started the turn.

    0.3.265release notes

  • The first reply and result of a turn Claude Code starts itself now include user_message_uuid and user_message_uuids, identifying messages sent that it picked up mid-turn.

    0.3.265release notes

  • Added the initialize delivery option to send plugins over stdin, preventing the launch command line from growing with the plugin count and fixing Windows start failures with many plugins.

    0.3.261release notes

  • The success result message can include this field for remote-session latency breakdowns.

    0.3.260release notes

  • Thinking-token system messages can include the user message UUID that triggered the turn, linking thinking progress to that message.

    0.3.260release notes

  • Added the 'none' option to auto-deny permission prompts in sessions with nobody to answer them, without disabling auto mode's classifier.

    0.3.259release notes

  • Added to a turn's first reply frame and result to identify every user message the turn answered, including replies to several merged messages.

    0.3.259release notes

  • Adds a detail option: summary uses the last response's usage and local estimates without per-category token-count API calls; full remains the default.

    0.3.257release notes

  • Notifications for completed auto-backgrounded MCP tool calls can list returned files by reference, joined to the call via tool_use_id.

    0.3.257release notes

  • User messages carrying MCP tool results now include returned resource_link blocks, allowing hosts to render returned files without parsing result text.

    0.3.257release notes

  • Adds a per-server timeout for SDK-hosted MCP servers, overriding MCP_TOOL_TIMEOUT for that server's tool calls.

    0.3.248release notes

  • Added an optional flag to task entries so hosts can exclude housekeeping tasks from activity indicators.

    0.3.247release notes

  • Hosts that set CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST can provide modelPricing through managedSettings; an admin-managed settings source that sets modelPricing still takes precedence.

    0.3.246release notes

  • modelUsage[*].costBasis reports which price table was used to compute each model's costUSD.

    0.3.246release notes

  • When set, interrupt() aborts only the current turn and leaves background agents and workflows running; otherwise, and for one-shot string prompts, they stop.

    0.3.246release notes

  • Error results and the first assistant message or stream_event of each turn can include user_message_uuid, linking the reply or failure to the user message that triggered it.

    0.3.246release notes

  • Added to task_started events for subagent tasks and background Bash tasks, so handlers can identify backgrounded tasks.

    0.3.238release notes

  • Added to task_started events for subagent tasks, so handlers can access the task's spawn depth.

    0.3.238release notes

  • Added to UserPromptExpansion hook output, matching UserPromptSubmit.

    0.3.238release notes

  • PostToolUse hooks can return a short host-asserted note about a tool call's result, which the auto mode permission classifier reads alongside that result.

    0.3.236release notes

  • The type now includes the values system/init actually reports: ANTHROPIC_API_KEY, apiKeyHelper, /login managed key, and none.

    0.3.234release notes

  • A host-injected peer origin may declare the sending session's permission class, allowing a same-class message to reach a recipient that runs without asking.

    0.3.234release notes

  • The system/init message gains an optional effort field containing the session's applied effort level, or null when none is sent; it is set on Remote Control bridge init frames.

    0.3.234release notes

  • /context result messages now include a structured context_usage payload with the new SDKContextUsage type, allowing consumers to render the context-usage card without parsing markdown.

    0.3.232release notes

  • The system init message now includes terminal_slash_commands so Remote Control clients can hide terminal-oriented commands.

    0.3.229release notes

  • Agent tool results now carry through usage.output_tokens_details, making that usage detail available in AgentOutput.

    0.3.228release notes

  • Added dialogExpiry as a setting; the notes do not specify its behavior.

    0.3.224release notes

  • Added the peer-send-message subkind to task-notification, identifying notifications raised by a cross-session SendMessage.

    0.3.224release notes

  • Added JWT decoding support for sandbox credential masking, with maskClaims.

    0.3.224release notes

  • Added sigv4 for AWS SigV4 re-signing in sandbox credential-masking configuration.

    0.3.224release notes

  • Added an archive plugin config variant with a URL and optional SHA-256 for installing plugins from a zip over HTTPS.

    0.3.224release notes

  • Result messages for repeated 529 overload failures now include this field, allowing SDK consumers to detect overload terminations structurally.

    0.3.223release notes

  • With resumeSessionAt, declares the turn a truncating resume intends to drop; the CLI refuses the resume if anything else would be discarded.

    0.3.223release notes

  • Adds a control-protocol lifecycle hook event fired when a new working directory is registered mid-session.

    0.3.219release notes

  • Result and init messages include fast_mode_disabled_reason so SDK hosts can explain why fast mode is off.

    0.3.219release notes

  • Opt-in cancel_queued cancels queued and pending-dispatch messages alongside the abort.

    0.3.219release notes

  • Adds an SDK settings option for setting the advisory dynamic-workflow size guideline.

    0.3.219release notes

  • Each modelUsage entry now includes canonicalModel so downstream billing can look up the correct rate table for costUSD.

    0.3.218release notes

  • Each modelUsage entry now includes provider so downstream billing can look up the correct rate table for costUSD.

    0.3.218release notes

  • Concurrently-running subagents are capped at 20 by default; override the cap with CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS.

    0.3.217release notes

  • The success result message can include an optional request_sent_wall_ms for cross-host request-latency correlation.

    0.3.216release notes

  • The rewindFiles response can include an optional skippedLinks count for paths safety guards refused to restore or delete.

    0.3.216release notes

  • User messages include a sidecar with non_execution_kind and user_feedback so consumers can classify denied, interrupted, or cancelled tool calls without matching result prose.

    0.3.216release notes

  • The success result message can include an optional user_message_uuid for cross-host request-latency correlation.

    0.3.216release notes

  • The task-notification member can include subkind: 'scheduled-trigger' to mark deliveries that are the fired prompt of a user-configured scheduled task.

    0.3.214release notes

  • tool_progress messages can include subagent_retry so clients can show a subagent waiting out an API rate-limit retry.

    0.3.214release notes

  • tool_progress messages can include subagent_type so clients can show a subagent waiting out an API rate-limit retry.

    0.3.214release notes

  • The live stream adds an ISO-8601 timestamp to assistant messages; older emitters omit it, so consumers should fall back to receive time.

    0.3.211release notes

  • Rate-limit message prefix buckets are available as @alpha exports, letting consumers classify rate-limit messages without maintaining mirrored lists.

    0.3.211release notes

  • Adds timedOutAfterMs to BashToolOutput, set when a command is auto-backgrounded on timeout.

    0.3.210release notes

  • A published SDK type for the Agent tool's structured result now matches the emitted object exactly.

    0.3.207release notes

  • Stream-json and SDK sessions now emit frames reporting each uuid-stamped message's terminal state.

    0.3.206release notes

  • Peer-message session events now expose the decoded message body in a structured body field.

    0.3.205release notes

  • system/init advertises the interrupt_receipt_v1 capability for feature detection.

    0.3.205release notes

  • Peer-message session events now expose the sender display name in a structured name field.

    0.3.205release notes

  • Interrupt control responses now include still_queued, the UUIDs of queued async messages that will still run.

    0.3.205release notes

  • A system message now reports the full set of live background tasks on every membership change, letting consumers track background activity as a level instead of pairing task_started and task_notification edges.

    0.3.203release notes

  • Subagent session messages now include parent_agent_id, enabling developers to build depth-2+ agent trees from disk-persisted metadata.

    0.3.202release notes

  • SDK inputs now accept 'manual' as an alias for the 'default' permission mode.

    0.3.200release notes

  • The canUseTool callback options include requestId to correlate out-of-band permission responses.

    0.3.199release notes

  • Returning null suppresses the SDK's automatic control response.

    0.3.199release notes

  • Progress events include a blocked field indicating when an agent was blocked by the auto-mode safety classifier.

    0.3.199release notes

  • Adds a per-server request_timeout_ms option to the mcp_set_servers control request.

    0.3.198release notes

  • Hook input payloads now include prompt_id to correlate hook events with OpenTelemetry prompt-level events.

    0.3.196release notes

  • Adds a method to re-send the initialize control request and redeliver pending permission and dialog prompts after a transport gap.

    0.3.195release notes

  • Added the promptSuggestions option to Browser SDK query() to opt the remote CLI into emitting follow-up suggestions.

    0.3.193release notes

  • The usage response now includes model_scoped for per-model weekly limit windows with utilization and reset times.

    0.3.191release notes

  • NotebookEdit tool results now include old_source for replace and delete operations, enabling inline diffs.

    0.3.191release notes

  • The rateLimitType field adds seven_day_overage_included for per-model weekly usage limits.

    0.3.191release notes

  • Control requests now include agent_id; background agents forward permission prompts to canUseTool instead of auto-denying, and stdin stays open while background tasks run.

    0.3.186release notes

  • SDK schemas add a dedicated tool type for MCP resource directory listing, replacing the fallback inside ReadMcpResourceTool.

    0.3.186release notes

  • A new control request supports rewinding a conversation to a previous point with durable resume anchor support.

    0.3.186release notes

  • Adds canUserPurchaseCredits to SDKRateLimitInfo for detecting credits-required rate limits.

    0.3.181release notes

  • Adds errorCode to SDKRateLimitInfo for detecting credits-required rate limits.

    0.3.181release notes

  • Adds hasChargeableSavedPaymentMethod to SDKRateLimitInfo for detecting credits-required rate limits.

    0.3.181release notes

  • Adds icon_url to assistant messages, populated from MCP server directory metadata.

    0.3.181release notes

  • Assistant messages can include an optional sidecar with display-friendly tool-call names, allowing SDK consumers to render human-readable labels instead of raw wire names.

    0.3.179release notes

  • Remote Control workers send a worker_shutting_down system message on graceful exit so remote clients can show why the session ended.

    0.3.178release notes

  • The message's trigger field now includes the server_error and last_resort values.

    0.3.174release notes

  • The SDK plugins option accepts skipMcpDiscovery: true per plugin, letting hosts manage MCP connections without the engine re-reading the plugin's .mcp.json.

    0.3.172release notes

  • Added claude-fable-5 to SDK model types, making it available as a model identifier.

    0.3.170release notes

  • Added the fable alias to SDK model types, making it available as a model identifier.

    0.3.170release notes

  • Adds an sse option as an alternative to websocket for browser SDK consumers who prefer Server-Sent Events.

    0.3.169release notes

  • Adds an experimental Query method returning structured session cost, plan rate-limit, and local usage-behaviors data.

    0.3.169release notes

  • Stop and SubagentStop hook events now support additionalContext, enabling non-error feedback that continues the turn.

    0.3.163release notes

  • Refusal errors now include stop_details on assistant messages and in session transcripts.

    0.3.162release notes

  • ControlResponse gains an optional pending_permission_requests field, mirroring ControlErrorResponse.

    0.3.161release notes

  • SessionStart hooks can set the session title via hookSpecificOutput.sessionTitle.

    0.3.152release notes

  • Adds a hook event that lets hooks transform or hide assistant message text as it is displayed.

    0.3.152release notes

  • SessionStart hooks can return reloadSkills: true to trigger a skill re-scan.

    0.3.152release notes

  • A new export supports bun build --compile consumers by providing extractFromBunfs(binPath) to copy the platform native binary out of the compiled executable's virtual filesystem.

    0.3.144release notes

  • SDK message types and task system events now surface request_id.

    0.3.142release notes

  • SDK message types and task system events now surface subagent_type.

    0.3.142release notes

  • SDK message types and task system events now surface task_description.

    0.3.142release notes

Performance 6

  • The first turn after SpareProcess.claim() no longer waits up to 500 ms for stdio MCP servers when tool search loads their tools on demand.

    0.3.326release notes

  • While a SessionStart or Setup hook is running, startup now keeps only the newest hook_progress message for each hook instead of retaining every message until the hook resolves.

    0.3.304release notes

  • The browser SDK bundle is 40% smaller to download because it no longer bundles a Node crypto polyfill.

    0.3.300release notes

  • The SDK package is smaller and loads faster because sdk.mjs no longer bundles unused dependencies.

    0.3.281release notes

  • Improves query() session startup with in-process MCP servers by running their handshake inside the SDK; initialize may wait up to 250 ms for them.

    0.3.281release notes

  • The first turn no longer waits up to 2 seconds for connecting MCP servers from settings files or plugins whose tool search defers; options.mcpServers servers are still awaited.

    0.3.274release notes

Behavior and default changes 69

  • On Windows, resolveSettings now re-reads registry policy every 6 hours while none is set, instead of every 30 minutes.

    0.3.328release notes

  • Retries for most MCP servers on other machines reached over HTTPS by hostname continue for about a day after a drop, up from at most about 27 minutes.

    0.3.327release notes

  • Requests to an SDK MCP server now use a string JSON-RPC id instead of a number.

    0.3.326release notes

  • A tool list entry that does not look like a complete rule now triggers a warning on stderr and a system/informational message.

    0.3.326release notes

  • For Bash and Monitor, a list of rules alone is sent only when saving it would allow that command.

    0.3.325release notes

  • Adds a system/informational warning tagged hook_no_verdict when a PreToolUse hook cannot run or answer, or times out, without refusing its tool call.

    0.3.325release notes

  • The skillMd field is now optional.

    0.3.325release notes

  • The SDK was updated to parity with Claude Code; the notes do not specify which behaviors changed.

    0.3.322release notes

  • While the subagent waits for a response on a likely-cold prompt cache, a summary can wait up to 5 minutes and is not sent if the subagent ends first.

    0.3.318release notes

  • The status field in PushNotificationInput is now optional.

    0.3.318release notes

  • A warning message is added to the stream when a hook callback fails.

    0.3.317release notes

  • Background start-up work now waits until the first model request is sent, for about 10 seconds at most, when the first message arrives during start-up.

    0.3.311release notes

  • The embedded CLI is extracted into its own per-user temp directory, named claude-agent-sdk-<uid> or claude-agent-sdk on Windows, instead of Claude Code's temp root.

    0.3.309release notes

  • When the CLI answers on its own stdio, responses now include plugin ids, agent and skill file paths, and per-server MCP instruction token shares.

    0.3.304release notes

  • Now provides stable row ids; when the CLI answers on its own stdio, it also includes plugin ids, agent and skill file paths, and per-server MCP instruction token shares.

    0.3.304release notes

  • Fork subagents are now on by default in SDK sessions, matching the terminal; run_in_background remains available, and CLAUDE_CODE_FORK_SUBAGENT=0 turns them off.

    0.3.302release notes

  • In auto mode, the final report now runs as its own turn instead of being joined with another message from the same subagent.

    0.3.300release notes

  • maxThinkingTokens: 0 runs as adaptive thinking on models that cannot turn thinking off.

    0.3.300release notes

  • thinking: { type: 'disabled' } runs as adaptive thinking on models that cannot turn thinking off.

    0.3.300release notes

  • The default limit on MCP server instructions increased from 2,048 to 4,096 characters, including for in-process SDK servers.

    0.3.296release notes

  • The default limit on MCP tool descriptions sent up front increased from 2,048 to 4,096 characters.

    0.3.296release notes

  • Descriptions loaded through tool search, including those from in-process SDK servers, are now cut at 16,384 characters instead of 2,048.

    0.3.295release notes

  • When a long result is saved to a file or cut because it could not be, text kept past 500,000 characters is dropped with a note of how much.

    0.3.295release notes

  • The SDK now passes named option values to Claude Code in the same argument as their flag, using the --flag=value form.

    0.3.295release notes

  • The top-level approve field on SendMessage tool-use inputs is now always a boolean, so hosts need not infer it from raw input.

    0.3.292release notes

  • A person's priority now message moves running shell commands, agents and MCP calls to the background and joins the running turn instead of stopping it.

    0.3.286release notes

  • Setting ultracode to true preserves the current effort level instead of switching it to xhigh.

    0.3.284release notes

  • A renamed skill's directory name is added to its SlashCommand aliases when the name is plain and Claude Code has no command by that name.

    0.3.284release notes

  • Omitting max_thinking_tokens leaves the session's thinking budget unchanged; send null to reset it to the session default.

    0.3.283release notes

  • The CLI answers the host's initialize request before starting background start-up work, improving SDK session start-up.

    0.3.281release notes

  • Retry heartbeats continue while sub-agent work waits during unattended retry.

    0.3.280release notes

  • When asked during a running turn, side questions now see that turn's prompt, replies, and finished tool results so far.

    0.3.280release notes

  • A local host's declared scheduled-task fire is honored only in a process it started with this environment variable set to 1.

    0.3.280release notes

  • When an unattended retry waits on a usage limit, it emits a rate_limit_event with rejected and resetsAt as the wait begins.

    0.3.280release notes

  • With session-state events enabled, events report requires_action while an MCP elicitation waits on the user, as they do for permission prompts.

    0.3.280release notes

  • Usage report rows always carry is_active; reports relay rows only from a live server reply and none while the usage fetch is failing.

    0.3.277release notes

  • A one-line transcript notice appears when the SDK host's Stop or SessionStart hook callback times out, and is shown once until the host answers again.

    0.3.273release notes

  • Updated to parity with Claude Code v2.1.270; the notes do not specify which behaviors changed.

    0.3.270release notes

  • user_message_uuid, user_message_uuids and resume_reason are now stamped on a turn's first complete assistant message as well as its first stream event when partial messages are on.

    0.3.269release notes

  • The initialize success response always includes this field, empty when nothing is pending, so clients can distinguish it from an older CLI.

    0.3.268release notes

  • A model id the CLI does not know locally is confirmed with the API the first time a session uses it instead of being refused as unrecognized.

    0.3.268release notes

  • On an automatic re-run of an interrupted turn, this field now names that turn's last user prompt.

    0.3.268release notes

  • Recording now defaults on for custom prompts and appends; a mid-session prompt change takes effect at the next compaction.

    0.3.267release notes

  • Pass snapshot: false to keep per-request rendering.

    0.3.267release notes

  • user_message_uuid is now set on the first reply after each change of the message a turn is answering, rather than on one reply frame per turn.

    0.3.265release notes

  • Re-emits during an exceeded window on repeat 429s about once every 30 seconds per limit window, letting stream consumers refresh stale rate-limit state.

    0.3.260release notes

  • Validation errors now identify the offending key, allowed values, and actual length or count.

    0.3.260release notes

  • Lists a server whose connection attempt throws under added as well as reporting a failed row in mcp_status.

    0.3.257release notes

  • Agent tool calls emit periodic heartbeat progress like other long tools; heartbeat frames do not clear a subagent_retry indicator.

    0.3.257release notes

  • Updated the SDK to parity with Claude Code v2.1.252; the notes do not specify which behaviors changed.

    0.3.252release notes

  • Updated the SDK to parity with Claude Code v2.1.251.

    0.3.251release notes

  • The SDK was updated to parity with Claude Code v2.1.241.

    0.3.241release notes

  • A repeated initialize on a running process is followed by a snapshot of live background tasks, allowing reconnecting hosts to see work that is still running.

    0.3.239release notes

  • A result held back for background subagents in one-shot mode reports total_cost_usd, duration_api_ms, and modelUsage as of its release rather than the turn-end snapshot.

    0.3.239release notes

  • Updated the SDK to parity with Claude Code v2.1.237.

    0.3.237release notes

  • Bare headless (-p / SDK query() without canUseTool) now emits this stream event when a tool call is auto-denied.

    0.3.223release notes

  • SkillToolOutput now reports background: true when a forked skill is dispatched as a detached background agent.

    0.3.218release notes

  • Assistant messages truncated by interrupt() now carry aborted: true, allowing consumers to distinguish mid-stream partial messages from completed messages.

    0.3.214release notes

  • Plugin entries in system/init messages and reload_plugins responses now include each plugin's manifest version.

    0.3.214release notes

  • Query.interrupt() now returns the typed interrupt receipt.

    0.3.205release notes

  • Updated the SDK to parity with Claude Code v2.1.201.

    0.3.201release notes

  • Updated the SDK to parity with Claude Code v2.1.185.

    0.3.185release notes

  • Advisory messages now carry typed denial reasons safetyCheck and asyncAgent, letting SDK consumers programmatically match denial causes.

    0.3.178release notes

  • SDK consumers now receive this message for overloaded, server_error, and last_resort fallback triggers, in addition to model_not_found and permission_denied.

    0.3.174release notes

  • The SDK was updated to match Claude Code, which may affect its behavior for developers.

    0.3.165release notes

  • Refusal errors now expose stop_reason as refusal on assistant messages and in session transcripts, allowing consumers to detect refusals without matching error text.

    0.3.162release notes

  • Agent changes now apply in a running session on the next turn; passing null resets the active agent.

    0.3.161release notes

  • The SDK was updated to parity with Claude Code v2.1.156.

    0.3.156release notes

  • Updated the SDK to parity with Claude Code v2.1.153.

    0.3.153release notes

Tooling 1

  • Now a peerDependency instead of a dependency; runtime is unaffected, and yarn classic users should add it explicitly for full TypeScript type resolution.

    0.3.143release notes

Fixes and other changes 166

  • An agent loaded from an agents directory now retains its system prompt when systemPrompt is not set.

    0.3.328release notes

  • The model no longer says background agents are still running after an SDK interrupt has stopped them.

    0.3.328release notes

  • Prevents Claude from reporting a background agent as still running when its permission request waited on canUseTool for 30 seconds or more.

    0.3.327release notes

  • A background subagent wake event no longer sends Claude Code's own text as the prompt; the event has no prompt.

    0.3.327release notes

  • Hook requests arriving while the SDK is starting up are now answered instead of refused.

    0.3.326release notes

  • Fixed failure on an empty reply and loss of recent turns after a crash when the previous turn ended with one.

    0.3.326release notes

  • Fixed tool results being lost or delivered to another call when a long call overlapped a reconnect of the SDK MCP servers.

    0.3.326release notes

  • A tool call in a running turn is now refused if it targets an MCP server removed with setMcpServers(), rather than reconnecting to it or reporting that authentication is needed.

    0.3.326release notes

  • Model info no longer lists effort levels above the organization's effort cap or the maxEffortLevel setting.

    0.3.325release notes

  • Forking at a compaction summary no longer restores messages kept after it, and forking at a compaction boundary keeps the conversation before it.

    0.3.323release notes

  • Includes a queued prompt that directly follows a compaction summary.

    0.3.323release notes

  • Reports a project-enabled plugin that is not installed, including its install command.

    0.3.323release notes

  • Options such as agents and skills are no longer ignored when a SessionStart hook supplies the first message.

    0.3.323release notes

  • Re-reads macOS MDM profiles and Windows registry policies after 30 minutes, and sooner after a failed read, instead of retaining the first reading for the process lifetime.

    0.3.323release notes

  • Progress notifications are no longer dropped for tool calls that were still running when the set of SDK MCP servers changed.

    0.3.323release notes

  • A server removed and re-added while a tool call tried to reach it no longer remains needs-auth with no tools.

    0.3.323release notes

  • Assistant messages now also send supersedes after a response whose tool call could not be parsed.

    0.3.323release notes

  • Adds tool_use_result to a subagent's WebSearch result message when the search did not run or found nothing.

    0.3.323release notes

  • decisionReason no longer gets the app's own PreToolUse hook reason when another hook also asked.

    0.3.321release notes

  • Setting one event in the hooks option to undefined no longer drops every hook.

    0.3.321release notes

  • The function no longer fails to reject when memory runs out while a transcript is being read.

    0.3.321release notes

  • A hook's ask is no longer lost when another hook's defer finishes first and cannot be honored.

    0.3.321release notes

  • Project commands and agents are no longer dropped when a worktree lacks them after Claude entered it.

    0.3.321release notes

  • Project skills are no longer dropped when a worktree lacks them after Claude entered it.

    0.3.321release notes

  • On the bundled Claude Code binary, initialize is read during boot, making startup work less likely to run before hooks are registered.

    0.3.321release notes

  • Sessions no longer hang on save when memory runs out while a transcript is being read.

    0.3.321release notes

  • Passing an in-process server with the same name no longer closes a folder's .mcp.json or local-scope MCP server in sessions bound with SpareProcess.claim().

    0.3.321release notes

  • Project skills, commands and agents are no longer dropped when a worktree lacks them after Claude entered it.

    0.3.321release notes

  • A string prompt no longer hangs after startup with resume if the resumed session finishes a turn before the prompt is sent.

    0.3.321release notes

  • Prewarmed processes count toward the metric only once, when SpareProcess.claim() succeeds, rather than when they are never claimed.

    0.3.319release notes

  • After /clear in a session resumed from a transcript file outside the projects folder, session_writes_lost now lists the correct session.

    0.3.319release notes

  • An interrupt response now lists a message held behind a model change, cancels it with cancel_queued, and stops it at start-up as a queued message is.

    0.3.318release notes

  • Fixes setMcpServers closing a folder's .mcp.json and local-scope MCP servers in sessions started with prewarm() and bound with SpareProcess.claim().

    0.3.317release notes

  • resolveSettings() now reads managed auto-mode settings as the CLI does, and skips user or project settings files whose auto-mode keys hold an invalid value.

    0.3.312release notes

  • An already-extracted file is reused only when its bytes match the embedded binary; otherwise, it is replaced.

    0.3.309release notes

  • Servers set with setMcpServers are no longer replaced later in the session by a same-named server from the user's own settings.

    0.3.305release notes

  • Setting initializeTimeoutMs to null no longer counts time spent in SessionStart or Setup hooks against the 60-second limit; null works like leaving the option out.

    0.3.305release notes

  • The startup and prewarm timeout error for a start with no open SessionStart or Setup hook lists possible causes and no longer says to check authentication and network.

    0.3.305release notes

  • When initializeTimeoutMs is omitted, time spent running a SessionStart or Setup command hook no longer counts toward the 60-second startup limit for up to 10 minutes; timeout errors now say what the process reported.

    0.3.304release notes

  • Continues reporting a tool's _meta.ui.visibility when the rest of its _meta.ui fails validation.

    0.3.301release notes

  • A model ID now applies even when the account is at its five-hour or weekly usage limit; the next message reports the limit.

    0.3.301release notes

  • Transcript rows containing Unicode line or paragraph separators are no longer skipped on Node 24 and Bun.

    0.3.300release notes

  • When refusing with “unseen later turn,” the operation no longer stops the running turn first.

    0.3.300release notes

  • When queued user messages with content-block arrays are merged into one turn, they now have a line break between them.

    0.3.299release notes

  • For a message stopped during prompt hooks or plugins, rewind now returns rewound: true with null prefillText until a reply or input follows.

    0.3.299release notes

  • In-process SDK MCP servers named constructor or toString are no longer silently dropped when a prewarm() process is claimed.

    0.3.299release notes

  • The sandbox option now merges with an inline settings.sandbox block; option values win, and deny and credential lists from both are combined.

    0.3.296release notes

  • For permission answers received after a restart, a malformed updatedPermissions list is ignored as a whole.

    0.3.296release notes

  • Assistant text blocks no longer lose citations in streamed responses.

    0.3.295release notes

  • Fixes an MCP server added with mcp_set_servers sometimes keeping an outdated tool list when another server in the same request connects later.

    0.3.295release notes

  • Events with status allowed_warning now include overageDisabledReason, as allowed and rejected events already do.

    0.3.295release notes

  • Events with status allowed_warning now include overageResetsAt, as allowed and rejected events already do.

    0.3.295release notes

  • Events with status allowed_warning now include overageStatus, as allowed and rejected events already do.

    0.3.295release notes

  • Claude is no longer told an in-process MCP server was disabled by the user when it was switched off with toggleMcpServer().

    0.3.295release notes

  • When auto mode is unavailable, tool calls from subagents with a declared auto permission mode are decided by the canUseTool callback instead of the auto-mode classifier.

    0.3.292release notes

  • A repeated user message with the same UUID is replayed when a turn takes it, rather than while its first copy is still waiting for its turn.

    0.3.290release notes

  • Failed Claude in Chrome tool calls now include _meta in tool_use_result when the result has one, matching other MCP tools.

    0.3.290release notes

  • This field is now also set on a turn resumed by a restarted worker after a permission answer or while tool calls are still in flight.

    0.3.290release notes

  • Streams no longer leave a message without message_stop when cut, interrupted, or falling back to non-streaming.

    0.3.287release notesrelease notes

  • The response now includes commands registered at startup, preventing commands_changed from arriving before init or twice at session start.

    0.3.287release notes

  • A revoked claude.ai login now reports this specific authentication error instead of a generic or access-related message.

    0.3.287release notes

  • In-process MCP tool calls no longer remain waiting when this API removes their server.

    0.3.287release notes

  • In-process MCP tool calls no longer remain waiting when this API disables their server.

    0.3.287release notes

  • Fixed foreground subagents sometimes not receiving the task-tracking tools listed in tools or allowedTools.

    0.3.286release notes

  • When a tool's schema cannot be converted to JSON Schema, the server leaves that tool out with a warning naming it, rather than listing no tools.

    0.3.286release notes

  • Fixed disconnecting and re-enabling in-process MCP servers created with createSdkMcpServer(), except one named claude-in-chrome.

    0.3.286release notes

  • With CLAUDE_CODE_FORK_SUBAGENT=1, a subagent's own Agent call now runs in the foreground so the subagent gets the child's result.

    0.3.285release notes

  • Now includes a message sent while Claude was working if the process stops before the reply or another prompt follows without a reply in between.

    0.3.285release notes

  • Rewinding a conversation now stops a backgrounded MCP tool call started by the message that was removed.

    0.3.285release notes

  • Calling toggleMcpServer(name, false) now closes the connection for a server that had not connected when the session started or whose config changed after connecting.

    0.3.285release notes

  • Fixes forked sessions reading the wrong history in cases involving rewinds, progress rows, fork briefings, or compaction with messages kept.

    0.3.284release notes

  • Includes messages from other agents, sessions, and channels that appear in the CLI transcript.

    0.3.284release notes

  • Keeps stdin open for a follow-up turn woken by a finished background agent, preventing its hooks, canUseTool, and SDK MCP calls from failing with “Stream closed.”

    0.3.284release notes

  • No longer copies a rewound-away branch when the newest branch ends at a meta row or a local command's rows.

    0.3.283release notes

  • No longer returns a rewound-away branch when the newest branch ends at a meta row or a local command's rows.

    0.3.283release notes

  • Output now includes warnings and notices raised during a turn as system/informational messages instead of dropping them.

    0.3.283release notes

  • Permission and dialog callbacks are no longer invoked for requests that arrive after close().

    0.3.281release notes

  • Fixes control requests issued after a query closed hanging or leaking.

    0.3.281release notes

  • Permission prompts can now be cancelled after a cancelled request is redelivered.

    0.3.281release notes

  • Fixes session_state_changed remaining at requires_action after overlapping permission and sandbox network-access prompts are answered.

    0.3.281release notes

  • Updated the SDK to parity with Claude Code v2.1.278; the notes do not specify individual changes.

    0.3.278release notes

  • Resumed or forked sessions now continue get_usage totals from earlier turns instead of starting at zero; maxBudgetUsd is unchanged.

    0.3.277release notes

  • Resumed or forked sessions now continue modelUsage totals from earlier turns instead of starting at zero; maxBudgetUsd is unchanged.

    0.3.277release notes

  • Usage report rows always carry severity; reports relay rows only from a live server reply and none while the usage fetch is failing.

    0.3.277release notes

  • Resumed or forked sessions now continue total_cost_usd from earlier turns instead of starting at zero; maxBudgetUsd is unchanged.

    0.3.277release notes

  • forkSession({ upToMessageId }) now accepts a client-supplied SDKUserMessage.uuid that is not in UUID format.

    0.3.275release notes

  • forkSession now accepts the id returned by getSessionMessages for a message sent while Claude was working.

    0.3.275release notes

  • A fork no longer shows a re-run prompt twice.

    0.3.275release notes

  • Calling getSessionMessages() right after a turn's result message no longer sometimes misses the assistant message.

    0.3.275release notes

  • Queued messages Claude read while running a tool, including task notifications, now appear in the returned messages where Claude read them.

    0.3.275release notes

  • Deferred tool call results now use the tool_use_result key when the tool reruns at the start of a resumed turn.

    0.3.275release notes

  • Messages sent while Claude was running a tool are now returned as user messages where Claude read them.

    0.3.274release notes

  • Replayed user messages now include the task-notification origin when a background task finishes during a running turn.

    0.3.274release notes

  • Timed-out Stop, SubagentStop, or SessionStart hook callbacks now count as no decision instead of being reported as failures and discarding other hooks' decisions.

    0.3.273release notes

  • The browser SSE transport no longer drops live slash-command list updates.

    0.3.273release notes

  • Fixes finding sessions when dir is on a mapped network drive or SUBST drive on Windows.

    0.3.271release notes

  • Fixes resume losing the global config when it is stored under the legacy .config.json name or an OAuth-suffixed file name.

    0.3.271release notes

  • Interrupts and permission responses are no longer delayed while OAuth sign-in waits on a slow authorization server.

    0.3.269release notes

  • Fixed permission_denials omitting Read, Edit and Write calls blocked by a path-scoped deny rule.

    0.3.269release notes

  • task_started and task_notification now carry the agent's last call id when the CLI resumes a background subagent on its own.

    0.3.269release notes

  • A shell working directory changed with cd now persists across turns in multi-turn sessions instead of resetting to the cwd option at each new user message.

    0.3.265release notes

  • The success result now includes user_message_uuid when a turn sends no API request, such as for a slash command.

    0.3.265release notes

  • Fixed query() throwing "Object not disposable" in runtimes without a native Symbol.dispose, including certain Node vm contexts and Node <18.18.

    0.3.261release notes

  • Results now append the last StructuredOutput tool error.

    0.3.260release notes

  • The value "disable" is no longer dropped by the restrictive-only filter and turns auto mode off for the spawned session.

    0.3.260release notes

  • The browser SDK bundle now streams messages on engines without native Symbol.dispose, including Safari/iOS, Firefox ESR, and older Chromium.

    0.3.257release notes

  • Acts on the server configured through --mcp-config or mcp_set_servers rather than a same-named server in .mcp.json or ~/.claude.json.

    0.3.257release notes

  • Disabling a server no longer removes tools belonging to a sibling MCP server whose name extends the disabled server's name.

    0.3.257release notes

  • Adds thinkingTokens as a subset of outputTokens and reports the session's real thinking-token count in result-message usage.

    0.3.257release notes

  • Stops a long-running background subagent when giving up, preventing it from remaining listed or emitting events after its stopped notification.

    0.3.257release notes

  • A background Bash task still running when a stream-json session ends immediately after an interrupt now receives its final notification.

    0.3.257release notes

  • Per-turn system/init frames now report the permission mode at turn start, avoiding a stale value when the mode switches right after submitting.

    0.3.247release notes

  • Fixes array systemPrompt handling so SYSTEM_PROMPT_DYNAMIC_BOUNDARY is not sent to the model as literal text on Bedrock, Vertex, Foundry, and gateway providers.

    0.3.239release notes

  • Setting this environment variable to true now keeps prompt_suggestion messages on when the account is near, but not over, its usage limit.

    0.3.238release notes

  • A cross-session peer message declined by the session's receive-side policy now reports the terminal state refused instead of producing no lifecycle frames.

    0.3.238release notes

  • The response now reports hooks_applied when a host re-sends initialize to an already-running CLI, fixing SDK hook callbacks silently not applying.

    0.3.238release notes

  • Events report the directory the shell finished in, reflecting an inner cd.

    0.3.234release notes

  • Notification hooks now fire for pending permission prompts on the SDK path, matching interactive REPL behavior.

    0.3.233release notes

  • vcs_state_changed events now populate branch for push operations, sourced from the pushed ref.

    0.3.232release notes

  • Updated the SDK to parity with Claude Code v2.1.231; the notes do not specify which behaviors changed.

    0.3.231release notes

  • Fixed background subagents in headless/SDK sessions not resuming when a background shell command or Monitor they left running completed, so they can see the result.

    0.3.225release notes

  • Resumed subprocesses now carry user settings.json values for apiKeyHelper, env, hooks, and permissions.

    0.3.222release notes

  • External MCP servers passed via this option are connected before the first turn, preventing the model from emitting tool calls as literal text.

    0.3.221release notes

  • The initialize response now reports fast_mode_state from the current model after a model switch, rather than from the spawn-time model.

    0.3.219release notes

  • The result event now reports 429 or 529 instead of null for rate-limit and overloaded errors delivered mid-stream.

    0.3.218release notes

  • Fixed pending permission prompts not being re-sent to clients that connect after the prompt appeared.

    0.3.217release notes

  • The TypeScript type for effortLevel now accepts 'max', which was already supported at runtime.

    0.3.214release notes

  • Agent tool output now includes the resolved model when a mid-turn model swap changed the subagent's model.

    0.3.212release notes

  • Dash-leading values are now passed to the CLI using equals-form, preventing them from being interpreted as separate argv tokens.

    0.3.212release notes

  • Process-exit errors include the CLI's stderr output, reporting the child process's actual cause instead of only an exit code.

    0.3.211release notes

  • With --include-partial-messages, the turn-start user replay is emitted before the turn's content events instead of after the first content block.

    0.3.211release notes

  • Streaming queries sharing one controller no longer accumulate abort listeners on its signal after each completed query.

    0.3.208release notes

  • Dash-leading extraArgs values are now bound with equals-form argv instead of being parsed as their own CLI flags.

    0.3.208release notes

  • Clarified that MCP_TOOL_TIMEOUT is the environment variable for configuring the MCP tool-call timeout.

    0.3.208release notes

  • A caller abort during a pending hook callback no longer becomes hook success, preventing PreToolUse-gated tools from executing after the abort.

    0.3.208release notes

  • Fixed a per-query resource leak when spawning the CLI fails because the executable path is nonexistent or inaccessible.

    0.3.208release notes

  • Fixed an uncaught exception when writing to stdin after the Claude Code subprocess has exited.

    0.3.208release notes

  • A hook callback timeout now blocks the prompt with a clear timeout message while allowing the session to continue, rather than killing the query with an empty error.

    0.3.208release notes

  • Allowing a tool without updatedInput now runs it with the original input instead of rejecting it with a raw ZodError message.

    0.3.207release notes

  • Zero-API results no longer report stale duration_api_ms values.

    0.3.206release notes

  • Fixed stable releases shipping sdk.d.ts with unresolved type references that broke consumer typechecking when skipLibCheck was disabled.

    0.3.203release notes

  • Non-object settings values now return a control error instead of crashing the session.

    0.3.202release notes

  • The callback now fires for SDK-hosted Remote Control sessions.

    0.3.200release notes

  • Prevents workflow progress events from silently dropping earliest agents while the phase counter remains correct.

    0.3.198release notes

  • Fixed deduplication dropping tool-use IDs after 1000 resolutions, which could cause duplicate tool_result deliveries in long-running sessions.

    0.3.196release notes

  • Ensures the event is emitted for synced skills when the skill list resolves before the change-detector subscribes.

    0.3.195release notes

  • Fixed brief console window flashes on Windows when spawning CLI subprocesses.

    0.3.193release notes

  • Fast mode no longer reverts to standard after the first turn when settingSources includes user or project settings.

    0.3.191release notes

  • SDK-hosted Remote Control sessions no longer drop file_attachments from inbound user messages.

    0.3.181release notes

  • Fixed -p mode exiting before a completed background agent's notification arrived, which could cause interim text to be delivered as the final result.

    0.3.179release notes

  • The turn result is emitted at the turn boundary, and the session reports idle while background tasks continue.

    0.3.179release notes

  • Spawn failures on an existing native binary now explain a likely musl/glibc mismatch and suggest options.pathToClaudeCodeExecutable.

    0.3.178release notes

  • Hook block feedback is now emitted to the SDK event stream, so consumers can see why a prompt was blocked instead of encountering a silent hang.

    0.3.178release notes

  • Fixed background agent, remote agent, and MCP task state not being restored when resuming a session via the SDK.

    0.3.176release notes

  • Fixed turn result messages being dropped when multiple turns complete while a background agent or workflow is running.

    0.3.176release notes

  • Input such as / add tests is no longer silently dropped and is treated as a plain prompt.

    0.3.172release notes

  • Fixed MCP resource tools not being injected for servers added at runtime via the mcp_set_servers control request.

    0.3.166release notes

  • SDK hosts can add builtin MCP servers with setMcpServers even when the CLI was launched without them.

    0.3.163release notes

  • stop_task control requests now return success when the target task is already gone, allowing SDK clients to reliably prune stale task chips.

    0.3.163release notes

  • A second initialize request returns the same success payload instead of an Already initialized error.

    0.3.161release notes

  • Aborting during a PostToolUse hook now ends the turn with a final result message instead of hanging the calling process.

    0.3.160release notes

  • Fixed stdio MCP servers being incorrectly restarted on every reconcile pass because of config-equality false positives.

    0.3.154release notes

  • Fixed custom options.env dropping CLAUDE_AGENT_SDK_VERSION, which is used for User-Agent and telemetry.

    0.3.149release notes

  • Clarified that Options.env replaces the subprocess environment rather than merging with process.env.

    0.3.149release notes

  • The api_error_status field on result messages is now documented.

    0.3.144release notes

  • Assistant messages and StopFailure hooks now report error: 'model_not_found' when the selected model doesn't exist or isn't available, instead of 'invalid_request'.

    0.3.144release notes

@anthropic-ai/claude-agent-sdk 0.2163 changes

Breaking changes 5

  • Added to PostToolUseHookSpecificOutput to replace tool output on all tools.

    0.2.121release notes

  • options.env replaces process.env for the CLI subprocess instead of overlaying it; include process.env to add or override individual variables.

    0.2.113release notes

  • options.env now overlays the inherited process.env instead of replacing it.

    0.2.111release notes

  • When enabled is true, failIfUnavailable now defaults to true; query() emits an error result and exits if sandbox dependencies are missing. Set it to false to allow graceful degradation.

    0.2.91release notes

  • session_state_changed events are opt-in; set this environment variable to 1 to receive them.

    0.2.83release notes

Security 1

  • Added a hook event that fires when configuration files change during a session, enabling enterprise security auditing and optional blocking of settings changes.

    0.2.49release notes

Deprecations 4

  • The TodoWrite tool is deprecated; future versions will switch to Task tools (TaskCreate, TaskGet, TaskUpdate, TaskList).

    0.2.136release notes

  • Passing 'Skill' in allowedTools is deprecated; use the skills option instead.

    0.2.133release notes

  • The unstable V2 session API is deprecated; use query() instead.

    0.2.133release notes

  • Deprecated in favor of updatedToolOutput, which can replace tool output on all tools.

    0.2.121release notes

New APIs and options 80

  • Exported from @anthropic-ai/claude-agent-sdk/sdk-tools and included in the ToolInputSchemas union.

    0.2.141release notes

  • Exported from @anthropic-ai/claude-agent-sdk/sdk-tools and included in the ToolOutputSchemas union.

    0.2.141release notes

  • The task input types are now included in this union.

    0.2.141release notes

  • The task output types are now included in this union.

    0.2.141release notes

  • Adds an alpha API to inspect effective merged settings without spawning the Claude CLI; it reads MDM (plist/HKLM/HKCU) for parity with CLI startup.

    0.2.136release notes

  • Top-level keys can now be set to null to clear flag-settings overrides.

    0.2.132release notes

  • Result messages now include the triggering message's origin, letting consumers distinguish user-prompted results from task-notification followups.

    0.2.126release notes

  • Lets embedders pass policy-tier settings to the spawned CLI in-memory, honored below IT-controlled managed sources.

    0.2.118release notes

  • Removes a session from disk or a SessionStore.

    0.2.113release notes

  • The alpha sessionStore option and session helpers mirror session transcripts to external storage.

    0.2.113release notes

  • The title option sets the session title and skips auto-generation.

    0.2.113release notes

  • Adds a mirror_error message to the SDKMessage union when a sessionStore.append() batch fails.

    0.2.113release notes

  • Remote HTTP/SSE server entries can carry per-tool permission policies that are applied to the session's allow/deny rules.

    0.2.111release notes

  • Opus 4.7 is now available, and this SDK version is required to use it.

    0.2.111release notes

  • Adds an optional field; set it to false to append a user message without triggering an assistant turn. Such messages no longer trigger auto-title generation, prompt suggestions, or UserPromptSubmit hooks.

    0.2.110release notes

  • Adds memory_paths on system/init so SDK renderers can surface memory operations.

    0.2.105release notes

  • Adds an event for SDK renderers to surface memory operations.

    0.2.105release notes

  • The public PermissionMode type now includes 'auto'.

    0.2.91release notes

  • Result messages can expose why the query loop terminated, such as completed, aborted_tools, max_turns, or blocking_limit.

    0.2.91release notes

  • Adds an option to optionally include system messages in session history.

    0.2.89release notes

  • Adds a function to retrieve subagent conversation history from sessions.

    0.2.89release notes

  • Adds an option to enable hook lifecycle messages for all hook event types.

    0.2.89release notes

  • Adds startup() to pre-warm the CLI subprocess before query(), making the first query ~20x faster when startup cost can be paid upfront.

    0.2.89release notes

  • Adds a control method that retrieves a breakdown of context window usage by category.

    0.2.86release notes

  • Adds an SDK method to reload plugins and receive refreshed commands, agents, and MCP server status.

    0.2.85release notes

  • Adds a field on McpServerStatus for SDK-driven MCP channel activation.

    0.2.84release notes

  • Exports the type 'low' | 'medium' | 'high' | 'max' so consumers can reference effort values directly.

    0.2.84release notes

  • Adds a method for SDK-driven MCP channel activation.

    0.2.84release notes

  • Adds API-side token budget awareness, allowing the model to pace tool use within a token limit.

    0.2.84release notes

  • Added a control subtype to seed readFileState with {path, mtime}, allowing Edit to work after the originating Read was removed from context.

    0.2.83release notes

  • Adds 'resume' to the ExitReason type to distinguish resume-triggered session ends in hooks.

    0.2.79release notes

  • Adds api_retry system messages for transient API retries, exposing the attempt count, maximum retries, delay, and error status.

    0.2.77release notes

  • Adds a control subtype to drop a queued user message by UUID before execution.

    0.2.76release notes

  • Adds forkSession(sessionId, opts?) for branching conversations from a point.

    0.2.76release notes

  • Adds hook types for handling MCP server input requests programmatically.

    0.2.76release notes

  • Adds the planFilePath field to ExitPlanMode tool input for hooks and SDK consumers.

    0.2.76release notes

  • Adds a system message for handling MCP server input requests programmatically.

    0.2.76release notes

  • Adds renameSession(sessionId, title, opts?) to rename session files.

    0.2.74release notes

  • Enables periodic AI-generated progress summaries for running foreground and background subagents.

    0.2.72release notes

  • Adds an applied section containing runtime-resolved model and effort values.

    0.2.72release notes

  • Progress summaries are emitted through a new summary field on task_progress events.

    0.2.72release notes

  • Hook events now include agent_id for subagents.

    0.2.69release notes

  • Hook events now include agent_type for subagents and --agent.

    0.2.69release notes

  • ModelInfo now indicates whether a model supports fast mode.

    0.2.69release notes

  • Configures whether the AskUserQuestion preview field uses markdown or html.

    0.2.69release notes

  • The Query interface gains supportedAgents() to view available subagents.

    0.2.63release notes

  • Adds a function to read a session's conversation history from its transcript file, with pagination via limit and offset options.

    0.2.59release notes

  • Adds an API for discovering and listing past sessions with light metadata.

    0.2.53release notes

  • Added task_progress events for real-time background agent progress reporting, including cumulative usage metrics, tool counts, and duration.

    0.2.51release notes

  • SDK model info now includes supportedEffortLevels so consumers can discover model capabilities.

    0.2.49release notes

  • SDK model info now includes supportsAdaptiveThinking so consumers can discover model capabilities.

    0.2.49release notes

  • SDK model info now includes supportsEffort so consumers can discover model capabilities.

    0.2.49release notes

  • Added a Query method to request prompt suggestions based on the current conversation context.

    0.2.47release notes

  • Added the tool_use_id field to task_notification events to correlate task completions with originating tool calls.

    0.2.47release notes

  • Added support for Claude Sonnet 4.6.

    0.2.45release notes

  • The SDK stream now emits a task_started system message when subagent tasks are registered.

    0.2.45release notes

  • Added a sessionId option to specify a custom UUID for conversations instead of using auto-generated ones.

    0.2.33release notes

  • Added the TaskCompleted hook event for handling task-completed events.

    0.2.33release notes

  • Added the input type for the TaskCompleted hook event.

    0.2.33release notes

  • Added the TeammateIdle hook event for handling teammate-idle events.

    0.2.33release notes

  • Added the input type for the TeammateIdle hook event.

    0.2.33release notes

  • Added to SDKResultSuccess and SDKResultError to indicate why the model stopped generating.

    0.2.31release notes

  • Adds the debug option for programmatic control of debug logging.

    0.2.30release notes

  • Adds the debugFile option for programmatic control of debug logging.

    0.2.30release notes

  • Adds an optional pages field for reading specific PDF page ranges.

    0.2.30release notes

  • Adds a parts output type for page-extracted PDF results.

    0.2.30release notes

  • Added a function to discover resumable sessions by project, repo, or globally.

    0.2.27release notes

  • The helper accepts optional annotations for specifying MCP tool hints.

    0.2.27release notes

  • Adds the config field for richer MCP server introspection.

    0.2.21release notes

  • Adds disabled as a status for MCP servers.

    0.2.21release notes

  • Adds the scope field for richer MCP server introspection.

    0.2.21release notes

  • Adds the tools field for richer MCP server introspection.

    0.2.21release notes

  • Adds a method for managing MCP server connections by reconnecting a server.

    0.2.21release notes

  • Adds a method for managing MCP server connections by toggling a server.

    0.2.21release notes

  • Directories specified via additionalDirectories can now provide CLAUDE.md files when CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD is enabled in the env option.

    0.2.20release notes

  • Set this environment variable to 1 in the env option to enable loading CLAUDE.md files from additionalDirectories.

    0.2.20release notes

  • Set this environment variable to true to opt into the new task system.

    0.2.19release notesrelease notes

  • The Query interface gained a close() method for forcefully terminating running queries.

    0.2.15release notes

  • Notification hook support was added.

    0.2.15release notes

  • Added a package.json field for programmatically determining the compatible CLI version.

    0.2.6release notes

Performance 2

  • Uses less memory for large sessions with compacted history.

    0.2.69release notes

  • Memory usage is improved for shell commands that produce large output; RSS no longer grows unboundedly with command output size.

    0.2.45release notes

Behavior and default changes 27

  • Updated the SDK to parity with Claude Code v2.1.137.

    0.2.137release notes

  • Updated to parity with Claude Code v2.1.129, which may affect SDK behavior.

    0.2.129release notes

  • Static auto-memory instructions now stay in the cacheable system-prompt block; only the per-user memory directory path and per-machine environment values move to the first user message.

    0.2.119release notes

  • Failures are retried up to 3 times with short backoff before the batch is dropped and mirror_error is emitted.

    0.2.119release notes

  • The SDK now spawns a native Claude Code binary via a per-platform optional dependency instead of bundled JavaScript.

    0.2.113release notes

  • The caller's active trace context is forwarded to the CLI subprocess so spans parent under the distributed trace.

    0.2.113release notes

  • startup() is now part of the public TypeScript API.

    0.2.111release notes

  • WarmQuery is now part of the public TypeScript API.

    0.2.111release notes

  • Auto session-title generation now respects this environment variable.

    0.2.110release notes

  • When enabled, emits a system status message with status requesting before each API request in the stream.

    0.2.108release notes

  • Adds requesting to SDKStatus for the status emitted before each API request when includePartialMessages is enabled.

    0.2.108release notes

  • Makes session_id optional when sending user messages; the SDK assigns one automatically.

    0.2.86release notes

  • subagent_type is now optional and defaults to the general-purpose agent when omitted.

    0.2.70release notes

  • AskUserQuestion annotations output is now exposed in the public SDK types.

    0.2.69release notes

  • The AskUserQuestion preview field is now exposed in the public SDK types.

    0.2.69release notes

  • Updated the SDK to parity with Claude Code v2.1.66.

    0.2.66release notes

  • The SDK was updated to parity with Claude Code v2.1.61.

    0.2.61release notes

  • The SDK was updated to parity with Claude Code v2.1.42; the notes do not specify which behaviors changed.

    0.2.42release notes

  • Updated to parity with Claude Code v2.1.37.

    0.2.37release notes

  • Updated the SDK to parity with Claude Code v2.1.36.

    0.2.36release notes

  • Updated to parity with Claude Code v2.1.29.

    0.2.29release notes

  • Updated the SDK to parity with Claude Code v2.1.25; the notes do not specify which behaviors changed.

    0.2.25release notes

  • The SDK was updated to parity with Claude Code v2.1.22.

    0.2.22release notes

  • Updated to parity with Claude Code v2.1.16.

    0.2.16release notes

  • Updated the SDK to parity with Claude Code v2.1.11; the notes do not specify which behaviors changed.

    0.2.11release notes

  • Updated the SDK to parity with Claude Code v2.1.9; the notes do not specify which developer-facing behaviors changed.

    0.2.9release notes

  • Updated to parity with Claude Code v2.1.6.

    0.2.6release notes

Fixes and other changes 44

  • Long-running SDK sessions now reconnect claude.ai-proxied MCP servers after a transport-stream abort.

    0.2.119release notes

  • Auto session-title generation now respects this environment variable.

    0.2.110release notes

  • The session-creation API now respects the allowDangerouslySkipPermissions option.

    0.2.110release notes

  • The session-creation API now respects the cwd option.

    0.2.110release notes

  • The session-creation API now respects the settingSources option.

    0.2.110release notes

  • Stops emitting this error when the final retry succeeds, preserving valid structured output.

    0.2.105release notes

  • Fixed MaxListenersExceededWarning when running 11 or more concurrent query() calls.

    0.2.101release notes

  • Fixed temporary directories leaking during resume-session cleanup on Windows and macOS/APFS.

    0.2.101release notes

  • A failed error-report write no longer crashes the SDK process with an unhandledRejection.

    0.2.94release notes

  • The agents breakdown now includes agents passed via options.agents.

    0.2.94release notes

  • MCP server child processes are now cleaned up when an SDK query() session ends.

    0.2.94release notes

  • CJK and other multibyte text is no longer corrupted when chunk boundaries split a UTF-8 sequence in stream-json input or output.

    0.2.94release notes

  • Preserves Zod v4 field .describe() metadata in tool schemas.

    0.2.89release notes

  • Fixes errors when single-turn queries with SDK MCP servers or hooks receive control responses after the result message.

    0.2.89release notes

  • Error result messages now correctly set is_error to true and include descriptive messages.

    0.2.89release notes

  • MCP servers retry on the next message instead of remaining permanently stuck in a failed state after a connection race.

    0.2.89release notes

  • Fixes an empty settingSources array causing --setting-sources "" to consume the next CLI flag.

    0.2.89release notes

  • Prevents side_question from returning null on resume before the first turn completes.

    0.2.89release notes

  • Fixes SDK mode so PreToolUse hooks with permissionDecision set to "ask" are not ignored.

    0.2.85release notes

  • Errors not caused by user interruption no longer show the message [Request interrupted by user].

    0.2.84release notes

  • Fixed the addRules suggestion when a write under .claude/skills/{name}/ hits the bypass-immune safety check.

    0.2.81release notes

  • Sessions with parallel tool calls now return all tool_use/tool_result pairs instead of dropping parallel tool results.

    0.2.80release notes

  • Fixes import type from this subpath under NodeNext/Bundler module resolution.

    0.2.74release notes

  • Skills with user-invocable: false are no longer included in supportedCommands() or the system:init message's slash_commands and skills lists.

    0.2.74release notes

  • Fixed options.env being overridden by the ~/.claude/settings.json env block when user is not included in settingSources.

    0.2.73release notes

  • No longer fails with "Server not found" for servers passed via query({mcpServers}).

    0.2.72release notes

  • Fixed type: "http" MCP servers failing with HTTP 406 on Streamable HTTP servers that strictly enforce the Accept header.

    0.2.70release notes

  • system:init and result events emit 'Task' again as the Agent tool name; migration to 'Agent' is planned for the next minor release.

    0.2.69release notes

  • SDK-mode MCP servers registered through initialize no longer disconnect when background plugin installation refreshes project MCP config.

    0.2.69release notes

  • Malformed updatedPermissions from SDK hosts are stripped and a warning is logged instead of a ZodError blocking tool calls.

    0.2.69release notes

  • MCP replacement tools using unprefixed MCP tool names are no longer incorrectly denied in subagents.

    0.2.63release notes

  • A bare command name such as "claude" now resolves via PATH when set as pathToClaudeCodeExecutable.

    0.2.63release notes

  • Updated the SDK to parity with Claude Code v2.1.55; the notes do not specify the individual changes.

    0.2.55release notes

  • Fixed an SDK ReferenceError crash when used inside compiled Bun binaries.

    0.2.51release notes

  • Fixed local slash command output not being returned to SDK clients.

    0.2.51release notes

  • Fixed unbounded memory growth in long-running SDK sessions by evicting old message UUID entries.

    0.2.51release notes

  • Fixed the v2 session API close behavior so the subprocess can persist session data, allowing resumeSession() to work.

    0.2.51release notes

  • Permission suggestions are populated when safety checks trigger an ask response, enabling SDK consumers to display permission options.

    0.2.49release notes

  • Session.stream() no longer returns prematurely while background subagents are running; intermediate result messages are held until all tasks complete.

    0.2.45release notes

  • The “(no content)” placeholder messages are no longer included in SDK output.

    0.2.30release notes

  • Now includes tools from the SDK and dynamically-added MCP servers.

    0.2.27release notes

  • Structured output validation errors are now reported correctly.

    0.2.23release notes

  • Structured outputs now handle empty assistant messages.

    0.2.22release notes

  • Fixes PermissionRequest hooks not being executed in SDK mode, such as in the VS Code extension.

    0.2.21release notes

@anthropic-ai/claude-agent-sdk 0.14 changes

Breaking changes 1

  • The V2 session API method is now named stream() instead of receive(), aligning with Anthropic SDK patterns.

    0.1.72release notes

Fixes and other changes 3

  • Fixed a bug where Stop hooks would not consistently run due to a Stream closed error.

    0.1.73release notes

  • The /context command now respects custom system prompts.

    0.1.72release notes

  • These queries now close immediately on the first result instead of waiting for the inactivity timeout.

    0.1.72release notes