- Fixed
type: "http"MCP servers failing with HTTP 406 "Not Acceptable" on Streamable HTTP servers that strictly enforce theAccept: application/json, text/event-streamheader - Changed
AgentToolInput.subagent_typeto optional — defaults to thegeneral-purposeagent when omitted - Updated to parity with Claude Code v2.1.70
- Added
toolConfig.askUserQuestion.previewFormatoption to configure the content format ('markdown'or'html') for thepreviewfield on AskUserQuestion tool options. Thepreviewfield andannotationsoutput are now exposed in the public SDK types. - Added
supportsFastModefield toModelInfoindicating whether a model supports fast mode - Added
agent_id(for subagents) andagent_type(for subagents and--agent) fields to hook events - Fixed SDK-mode MCP servers (registered via
sdkMcpServersin theinitializecontrol request) getting disconnected when background plugin installation refreshes project MCP config - Fixed breaking change:
system:initandresultevents now emit'Task'as the Agent tool name again (reverted from'Agent', which was an unintentional breaking change in a patch release). The wire name will migrate to'Agent'in the next minor release. - Fixed control responses with malformed
updatedPermissionsfrom SDK hosts blocking tool calls with a ZodError; the invalid field is now stripped and a warning is logged instead. - Improved memory usage of
getSessionMessages()for large sessions with compacted history
- Updated to parity with Claude Code v2.1.68
- Updated to parity with Claude Code v2.1.66
- SDK: Fixed
pathToClaudeCodeExecutablefailing when set to a bare command name (e.g.,"claude") that should resolve via PATH - Added
supportedAgents()method to the Query interface to view available subagents - Fixed MCP replacement tools being incorrectly denied in subagents when using unprefixed MCP tool names
- Updated to parity with Claude Code v2.1.61
- Added
getSessionMessages()function for reading a session's conversation history from its transcript file, with support for pagination vialimitandoffsetoptions
- Updated to parity with Claude Code v2.1.58
- Updated to parity with Claude Code v2.1.56
- Updated to parity with Claude Code v2.1.55
- Updated to parity with Claude Code v2.1.54
- Added
listSessions()for discovering and listing past sessions with light metadata
- Updated to parity with Claude Code v2.1.52
- Updated to parity with Claude Code v2.1.51
- Fixed SDK crashing with
ReferenceErrorwhen used inside compiled Bun binaries (bun build --compile) - Fixed unbounded memory growth in long-running SDK sessions caused by message UUID tracking never evicting old entries
- Fixed local slash command output not being returned to SDK clients
- Added
task_progressevents for real-time background agent progress reporting with cumulative usage metrics, tool counts, and duration - Fixed
session.close()in the v2 session API killing the subprocess before it could persist session data, which brokeresumeSession()
- Updated to parity with Claude Code v2.1.50
- Updated to parity with Claude Code v2.1.49
- SDK model info now includes
supportsEffort,supportedEffortLevels, andsupportsAdaptiveThinkingfields so consumers can discover model capabilities. - Permission suggestions are now populated when safety checks trigger an ask response, enabling SDK consumers to display permission options.
- Added
ConfigChangehook event that fires when configuration files change during a session, enabling enterprise security auditing and optional blocking of settings changes.
- Updated to parity with Claude Code v2.1.47
- Added
promptSuggestion()method onQueryto request prompt suggestions based on the current conversation context - Added
tool_use_idfield totask_notificationevents for correlating task completions with originating tool calls
- Updated to parity with Claude Code v2.1.46
- Added support for Claude Sonnet 4.6
- Added
task_startedsystem message to the SDK stream, emitted when subagent tasks are registered - Fixed
Session.stream()returning prematurely when background subagents are still running, by holding back intermediate result messages until all tasks complete - Improved memory usage for shell commands that produce large output — RSS no longer grows unboundedly with command output size
- Updated to parity with Claude Code v2.1.44
- Updated to parity with Claude Code v2.1.43
- Updated to parity with Claude Code v2.1.42
- Updated to parity with Claude Code v2.1.41
- Updated to parity with Claude Code v2.1.40
- Updated to parity with Claude Code v2.1.39
- Updated to parity with Claude Code v2.1.38
- Updated to parity with Claude Code v2.1.37
- Updated to parity with Claude Code v2.1.36
- Updated to parity with Claude Code v2.1.35
- Updated to parity with Claude Code v2.1.34
- Added
TeammateIdleandTaskCompletedhook events with correspondingTeammateIdleHookInputandTaskCompletedHookInputtypes - Added
sessionIdoption to specify a custom UUID for conversations instead of auto-generated ones - Updated to parity with Claude Code v2.1.33
- Updated to parity with Claude Code v2.1.32
- Added
stop_reasonfield toSDKResultSuccessandSDKResultErrorto indicate why the model stopped generating
- Added
debuganddebugFileoptions for programmatic control of debug logging - Added optional
pagesfield toFileReadToolInputfor reading specific PDF page ranges - Added
partsoutput type toFileReadToolOutputfor page-extracted PDF results - Fixed "(no content)" placeholder messages being included in SDK output
- Updated to parity with Claude Code v2.1.29
- Added optional
annotationssupport to thetool()helper function for specifying MCP tool hints (readOnlyHint, destructiveHint, openWorldHint, idempotentHint) - Fixed
mcpServerStatus()to include tools from SDK and dynamically-added MCP servers - Updated to parity with Claude Code v2.1.27
- Updated to parity with Claude Code v2.1.25
- Fixed structured output validation errors not being reported correctly
- Updated to parity with Claude Code v2.1.23
- Fixed structured outputs to handle empty assistant messsages
- Updated to parity with Claude Code v2.1.22
- Added
config,scope, andtoolsfields toMcpServerStatusfor richer server introspection - Added
reconnectMcpServer()andtoggleMcpServer()methods for managing MCP server connections - Added
disabledstatus toMcpServerStatus - Fixed PermissionRequest hooks not being executed in SDK mode (e.g., VS Code extension)
- Updated to parity with Claude Code v2.1.21
- Added support for loading CLAUDE.md files from directories specified via
additionalDirectoriesoption (requires settingCLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1in theenvoption) - Added
CLAUDE_CODE_ENABLE_TASKSenv var, set totrueto opt into the new task system - Updated to parity with Claude Code v2.1.20
- Added
CLAUDE_CODE_ENABLE_TASKSenv var, set totrueto opt into the new task system
- Updated to parity with Claude Code v2.1.17
- Updated to parity with Claude Code v2.1.16
- Added notification hook support
- Added
close()method to Query interface for forcefully terminating running queries - Updated to parity with Claude Code v2.1.15
- Updated to parity with Claude Code v2.1.14
- Updated to parity with Claude Code v2.1.12
- Updated to parity with Claude Code v2.1.11
- Added
skillsandmaxTurnsconfiguration options to custom agent definitions.
- Updated to parity with Claude Code v2.1.9
- Updated to parity with Claude Code v2.1.8
- Updated to parity with Claude Code v2.1.7
- Updated to parity with Claude Code v2.1.6
- Added
claudeCodeVersionfield topackage.jsonfor programmatically determining compatible CLI version
- Updated to parity with Claude Code v2.1.5
- Updated to parity with Claude Code v2.1.4
- Updated to parity with Claude Code v2.1.3
- Added
errorfield toMcpServerStatusfor failed MCP server connections - Updated to parity with Claude Code v2.1.0
- Updated to parity with Claude Code v2.0.78
- Updated to parity with Claude Code v2.0.75
- Updated to parity with Claude Code v2.0.74
- Fixed a bug where Stop hooks would not consistently run due to
Stream closederror - Updated to parity with Claude Code v2.0.73
- Fixed
/contextcommand not respecting custom system prompts - Fixed non-streaming single-turn queries to close immediately on first result instead of waiting for inactivity timeout
- Changed V2 session API method
receive()tostream()for consistency with Anthropic SDK patterns - Updated to parity with Claude Code v2.0.72
- Added zod
^4.0.0as peer dependency option in addition to zod^3.24.1 - Added support for AskUserQuestion tool. If using
toolsoption, enable by including'AskUserQuestion'in list - Fixed visible console window appearing when spawning Claude subprocess on Windows
- Fixed spawn message being sent to stderr callback (anthropics#45)
- Updated to parity with Claude Code v2.0.71
- Updated to parity with Claude Code v2.0.69
- Fixed a bug where disallowed MCP tools were visible to the model
- Updated to parity with Claude Code v2.0.68
- Updated to parity with Claude Code v2.0.67
- Fixed project MCP servers from
.mcp.jsonnot being available whensettingSourcesincludesproject - Updated to parity with Claude Code v2.0.66
- Updated to parity with Claude Code v2.0.66
- Fixed issues where SDK MCP servers, hooks, or canUseTool callbacks could fail when stdin was closed too early after the first result
- Updated to parity with Claude Code v2.0.64
- Updated to parity with Claude Code v2.0.63
- Updated to parity with Claude Code v2.0.61
- Updated to parity with Claude Code v2.0.60
- Updated to parity with Claude Code v2.0.59
- Updated to parity with Claude Code v2.0.58
- Added
betasoption to enable beta features. Currently supports'context-1m-2025-08-07'for 1M token context window on Sonnet 4/4.5. See https://docs.anthropic.com/en/api/beta-headers for more details.
- Updated to parity with Claude Code v2.0.57
- Added
toolsoption to specify the exact set of built-in tools available to the agent. Usetools: ['Bash', 'Read', 'Edit']for a strict allowlist,tools: []to disable all built-in tools, ortools: { type: 'preset', preset: 'claude_code' }for all default tools. Omitting this option preserves existing behavior where all built-in tools are available (and can be filtered withdisallowedTools).
- Updated to parity with Claude Code v2.0.56
- Update to parity with Claude Code v2.0.55
- Updated to parity with Claude Code v2.0.54
- Added experimental v2 session APIs (
unstable_v2_createSession,unstable_v2_resumeSession,unstable_v2_prompt) for simpler multi-turn conversations - Fixed a bug where ExitPlanMode tool input was empty
- Updated to parity with Claude Code v2.0.53
- Updated to parity with Claude Code v2.0.52
- Updated to parity with Claude Code v2.0.51
- Added support for Opus 4.5! https://www.anthropic.com/news/claude-opus-4-5
- Updated to parity with Claude Code v2.0.50
- Updated to parity with Claude Code v2.0.49
- Updated to parity with Claude Code v2.0.47
- Add
errorfield to some messages
- Updated to parity with Claude Code v2.0.46
- Add support for Microsoft Foundry! See https://code.claude.com/docs/en/azure-ai-foundry
- Structured outputs support. Agents can now return validated JSON matching your schema. See https://platform.claude.com/docs/en/agent-sdk/structured-outputs.
- Updated to parity with Claude Code v2.0.45
- Updated to parity with Claude Code v2.0.44
- Updated to parity with Claude Code v2.0.43
- Updated to parity with Claude Code v2.0.42
- Updated to parity with Claude Code v2.0.41
- Updated to parity with Claude Code v2.0.37
- Updated to parity with Claude Code v2.0.36
- Updated to parity with Claude Code v2.0.35
- Updated to parity with Claude Code v2.0.34
- Updated to parity with Claude Code v2.0.33
- Updated to parity with Claude Code v2.0.32
- Added --max-budget-usd flag
- Fixed a bug where hooks were sometimes failing in stream mode
- Updated to parity with Claude Code v2.0.31
- Updated to parity with Claude Code v2.0.29
- Updated to parity with Claude Code v2.0.28
- Fixed a bug where custom tools were timing out after 30 seconds instead of respecting
MCP_TOOL_TIMEOUT(anthropics#42)
- Updated to parity with Claude Code v2.0.27
- Added
pluginsfield toOptions
- Updated to parity with Claude Code v2.0.26
- Updated to parity with Claude Code v2.0.25
- Fixed a bug where project-level skills were not loading when
'project'settings source was specified - Added
skillsfield toSDKSystemMessagewith list of available skills - Fixed a bug where some exported types were not importing correctly (anthropics#39)
- Updated to parity with Claude Code v2.0.22
- Updated to parity with Claude Code v2.0.21
- Updated to parity with Claude Code v2.0.20
- Updated to parity with Claude Code v2.0.19
- Updated to parity with Claude Code v2.0.18
- Updated to parity with Claude Code v2.0.17
- Updated to parity with Claude Code v2.0.15
- Updated
envtype to not use BunDicttype - Startup performance improvements when using multiple SDK MCP servers
- Updated to parity with Claude Code v2.0.14
- Updated to parity with Claude Code v2.0.13
- Updated to parity with Claude Code v2.0.12
- Increased SDK MCP channel closure timeout to 60s, addressing anthropics#15
- Updated to parity with Claude Code v2.0.11
- Updated to parity with Claude Code v2.0.10
- Added zod ^3.24.1 as peer dependency
- Fixed a bug where system prompt was sometimes not getting set correctly: anthropics#8
- Updated to parity with Claude Code v2.0.1
- Merged prompt options: The
customSystemPromptandappendSystemPromptfields have been merged into a singlesystemPromptfield for simpler configuration - No default system prompt: The Claude Code system prompt is no longer included by default, giving you full control over agent behavior. To use the Claude Code system prompt, explicitly set:
- No filesystem settings by default: Settings files (
settings.json,CLAUDE.md), slash commands, and subagents are no longer loaded automatically. This ensures SDK applications have predictable behavior independent of local filesystem configurations - Explicit settings control: Use the new
settingSourcesfield to specify which settings locations to load:["user", "project", "local"] - Programmatic subagents: Subagents can now be defined inline in code using the
agentsoption, enabling dynamic agent creation without filesystem dependencies. Learn more - Session forking: Resume sessions with the new
forkSessionoption to branch conversations and explore different approaches from the same starting point. Learn more - Granular settings control: The
settingSourcesoption gives you fine-grained control over which filesystem settings to load, improving isolation for CI/CD, testing, and production deployments - Comprehensive documentation now available in the API Guide
- New guides for Custom Tools, Permissions, Session Management, and more
- Complete TypeScript API reference