What's changed
- Added
startup()to pre-warm the CLI subprocess beforequery(), making the first query ~20x faster when startup cost can be paid upfront - Added
includeSystemMessagesoption togetSessionMessages()to optionally include system messages in session history - Added
listSubagents()andgetSubagentMessages()functions to retrieve subagent conversation history from sessions - Added
includeHookEventsoption to enable hook lifecycle messages (hook_started,hook_progress,hook_response) for all hook event types - Fixed
ERR_STREAM_WRITE_AFTER_ENDerrors when single-turn queries with SDK MCP servers or hooks have control responses arriving after the result message - Fixed Zod v4 field
.describe()metadata being dropped fromcreateSdkMcpServertool schemas - Fixed
side_questionreturning null on resume before the first turn completes - Fixed
settingSourcesempty array causing--setting-sources ""to consume the next CLI flag - Fixed error result messages (
error_during_execution,error_max_turns,error_max_budget_usd) to correctly setis_error: truewith descriptive messages - Fixed MCP servers getting permanently stuck in a failed state after a connection race — they now retry on the next message
Update
npm install @anthropic-ai/claude-agent-sdk@0.2.89
# or
yarn add @anthropic-ai/claude-agent-sdk@0.2.89
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.2.89
# or
bun add @anthropic-ai/claude-agent-sdk@0.2.89