unstale

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

@anthropic-ai/claude-agent-sdk

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

44 breaking13 security1 deprecations154 new APIs and options4 performance49 behavior and defaults124 fixes and other

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

npx @unstale/cli init

@unstale/cli 0.2.0 on npm

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

Breaking changes 44

  • 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

Security 13

  • 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 1

  • 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 154

  • 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 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

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

    0.3.277release notes

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

    0.3.277release 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

  • Added to the browser SDK's SSE transport.

    0.3.267release notes

  • Added as an SSE option.

    0.3.267release notes

  • Added as an SSE option.

    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

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

    0.3.260release notes

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

    0.3.260release 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

Performance 4

  • 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 49

  • 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

Fixes and other changes 124

  • 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

  • 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

  • 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

  • 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

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

    0.3.284release 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 finding sessions when dir is on a mapped network drive or SUBST drive on Windows.

    0.3.271release 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

  • 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

  • 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