Packages

@anthropic-ai/claude-agent-sdk

0.3.330 · 20 Nov 2026SEE LICENSE IN README.md20.7M / weekRepositorynpmAtom feed

Your version

0.3.327

17 Nov 2026Where it was published

0.3.330 is the newest release of 0.3.x.

Summary· from the note as AI read it

Migration neededRead before upgrading: 5 changes to make.

Before you upgrade

  • Ensure query/startup/prewarm options are serializable; no circular or BigInt fields
  • Pass hook event values and matcher hooks as arrays
  • SDK MCP tool results may again be lost after reconnect; check reliance.To check
  • Handle numeric JSON-RPC ids for SDK MCP server requests again.To check
  • Move createSdkMcpServer servers from agent mcpServers to top-level mcpServers

New

  • Changed background retries for most MCP servers on other machines, reached by hostname over https, to go on for about a day after a drop, up from at most about 27 minutes

In short

5 breaking1 new2 fixed1 internal

  • Breaking

    Breaking: Changed query(), startup() and prewarm() to refuse options that can't be sent to Claude Code, such as an agent with a circular or BigInt field. Fix the named option.

  • Breaking

    Breaking: Changed hook options to require arrays: a hook event's value and a matcher's hooks. A Set, generator, plain object, true or number is now refused.

  • Breaking

    Reverted 0.3.326's fix for a tool result from an SDK MCP server being lost, or delivered to another call, after a reconnect

    To check
  • Breaking

    Changed the JSON-RPC id of requests to an SDK MCP server back from a string to a number

    To check
  • Breaking

    Deprecated createSdkMcpServer() servers in an agent's mcpServers: ignored with a warning, and other options apply. Move them to top-level mcpServers, which gives the main session their tools.

Release note

What's changed

  • Breaking

    Changed query(), startup() and prewarm() to refuse options that can't be sent to Claude Code, such as an agent with a circular or BigInt field. Fix the named option.

  • Breaking

    Changed hook options to require arrays: a hook event's value and a matcher's hooks. A Set, generator, plain object, true or number is now refused.

  • Fixed task_started sending Claude Code's own text, such as a task notification, as prompt when a background subagent is woken; such an event now has no prompt

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

  • Reverted 0.3.326's fix for a tool result from an SDK MCP server being lost, or delivered to another call, after a reconnect

  • Changed the JSON-RPC id of requests to an SDK MCP server back from a string to a number

  • Changed background retries for most MCP servers on other machines, reached by hostname over https, to go on for about a day after a drop, up from at most about 27 minutes

  • Deprecated

    Deprecated createSdkMcpServer() servers in an agent's mcpServers: ignored with a warning, and other options apply. Move them to top-level mcpServers, which gives the main session their tools.

  • Updated to parity with Claude Code v2.1.327

Update

npm install @anthropic-ai/claude-agent-sdk@0.3.327
# or
yarn add @anthropic-ai/claude-agent-sdk@0.3.327
# or
pnpm add @anthropic-ai/claude-agent-sdk@0.3.327
# or
bun add @anthropic-ai/claude-agent-sdk@0.3.327

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.