Install
npm install @anthropic-ai/claude-agent-sdkTypeScript port of the Claude Agent SDK. Same Computer Use, MCP, tool-use, and streaming capabilities — built for Node and browser environments.
Install
npm install @anthropic-ai/claude-agent-sdkVersion
v0.3.165 · June 2026 · Node 18+
Best for
Full-stack Claude apps, Node streaming servers, MCP-rich workflows.
@anthropic-ai/claude-agent-sdk@0.3.165 confirmed latest stable via npm registry (2026-06-05); query, tool, createSdkMcpServer, session helpers, and all constants unchanged.@anthropic-ai/claude-agent-sdk@0.3.162 confirmed latest stable via npm registry (2026-06-04); query, tool, createSdkMcpServer, session helpers, and all constants unchanged.@anthropic-ai/claude-agent-sdk@0.3.161 (/tmp/npm-0603); query, tool, createSdkMcpServer, session helpers, and all constants confirmed present.@anthropic-ai/claude-agent-sdk@0.3.160 (/tmp/npm-0602); query, tool, createSdkMcpServer, session helpers, and all constants confirmed present.@anthropic-ai/claude-agent-sdk@0.3.158 (/tmp/npm-check-0530); query, tool, createSdkMcpServer, session helpers, and all constants confirmed present.@anthropic-ai/claude-agent-sdk@0.3.156 (/tmp/npm-check-0529); query, tool, createSdkMcpServer, session helpers, and all constants confirmed present.query, tool, createSdkMcpServer, session helpers, error types, and constants).query, tool, createSdkMcpServer, session helpers, error types, and constants).@anthropic-ai/claude-agent-sdk@0.3.150 (.routine-envs/check-0523-node); query, tool, createSdkMcpServer, session helpers, and all constants confirmed present.@anthropic-ai/claude-agent-sdk@0.3.148 (.routine-envs/check-0522-node); query, tool, createSdkMcpServer, session helpers, and all constants confirmed present.@anthropic-ai/claude-agent-sdk@0.3.145 (.routine-envs/check-0520-node); query, tool, createSdkMcpServer, session helpers, and all constants confirmed present.unstable_v2_* preview exports (unstable_v2_createSession, unstable_v2_prompt, unstable_v2_resumeSession) that were present in 0.2.x have been removed; the package now exports 25 stable symbols. Full export surface verified against installed @anthropic-ai/claude-agent-sdk@0.3.144 (.routine-envs/check-0519-node): query, tool, createSdkMcpServer, session helpers (forkSession, listSessions, getSessionInfo, getSessionMessages, InMemorySessionStore, renameSession, tagSession, deleteSession, importSessionToStore, listSubagents, getSubagentMessages), error types (AbortError, DirectConnectError), transport (DirectConnectTransport, parseDirectConnectUrl), constants (EXIT_REASONS, HOOK_EVENTS, SYSTEM_PROMPT_DYNAMIC_BOUNDARY), and utilities (resolveSettings, startup, filterEscalatingDefaultMode, foldSessionSummary) all confirmed present. If your code referenced any unstable_v2_* export, remove or replace it.query, tool, createSdkMcpServer, session helpers, and the three unstable_v2_* preview exports (now removed in 0.3.x).query, tool, createSdkMcpServer) verified against installed @anthropic-ai/claude-agent-sdk@0.2.139 (.routine-envs/check-0512-node).InMemorySessionStore, createSdkMcpServer, forkSession, deleteSession, listSessions, getSessionInfo, getSessionMessages, getSubagentMessages, importSessionToStore, listSubagents, renameSession, tagSession, resolveSettings, startup. New error types: AbortError, DirectConnectError. New transport: DirectConnectTransport with parseDirectConnectUrl. New constants: EXIT_REASONS, HOOK_EVENTS, SYSTEM_PROMPT_DYNAMIC_BOUNDARY.@anthropic-ai/claude-code-sdk → @anthropic-ai/claude-agent-sdk); Computer Use; MCP; session management; hooks.There is no Agent class in @anthropic-ai/claude-agent-sdk 0.2.117. The public entry points are query() (one-shot) and the lower-level exports listed on the package. Earlier drafts of this page documented a new Agent({...}) constructor — it does not exist.
// One-shot queryimport { query } from '@anthropic-ai/claude-agent-sdk';
for await (const message of query({ prompt: 'What is 15 + 27?', options: { model: 'claude-3-5-sonnet-latest', systemPrompt: 'You are a helpful assistant.', },})) { console.log(message);}For richer session flows use the session helpers (forkSession, listSessions, InMemorySessionStore) or the MCP server factory createSdkMcpServer.
Ready? Start Zero → Hero Step 1 →
| Date | Framework version (installed) | Summary of changes | Reviewer |
|---|---|---|---|
| 2026-06-05 | @anthropic-ai/claude-agent-sdk 0.3.165 | Patch releases 0.3.163–0.3.165; “What’s new” heading updated to v0.3.165; three patch bullets added; comprehensive guide header updated; revision history entry added. @anthropic-ai/claude-agent-sdk@0.3.165 confirmed latest stable via npm registry (2026-06-05); 25-export surface unchanged. | Claude routine |
| 2026-06-04 | @anthropic-ai/claude-agent-sdk 0.3.162 | Patch release 0.3.162; “What’s new” heading updated to v0.3.162; patch bullet added; revision history entry added. @anthropic-ai/claude-agent-sdk@0.3.162 confirmed latest stable via npm registry (2026-06-04); 25-export surface unchanged. | Claude routine |
| 2026-06-03 | @anthropic-ai/claude-agent-sdk 0.3.161 | Patch release 0.3.161; “What’s new” heading updated to v0.3.161; patch bullet added; revision history entry added. All 25 exports verified against installed @anthropic-ai/claude-agent-sdk@0.3.161 (/tmp/npm-0603); query, tool, createSdkMcpServer, session helpers all PASS. Export count: 25 — PASS. | Claude routine |
| 2026-06-02 | @anthropic-ai/claude-agent-sdk 0.3.160 | Patch releases 0.3.159–0.3.160; “What’s new” heading updated to v0.3.160; two patch bullets added; comprehensive guide header updated; revision history entry added. All 25 exports verified against installed @anthropic-ai/claude-agent-sdk@0.3.160 (/tmp/npm-0602); query, tool, createSdkMcpServer, session helpers all PASS. Export count: 25 — PASS. | Claude routine |
| 2026-05-30 | @anthropic-ai/claude-agent-sdk 0.3.158 | Patch releases 0.3.157–0.3.158; “What’s new” heading updated to v0.3.158; two patch bullets added; comprehensive guide header updated; revision history entry added. All 25 exports verified against installed @anthropic-ai/claude-agent-sdk@0.3.158 (/tmp/npm-check-0530); query, tool, createSdkMcpServer, session helpers all PASS. Export count: 25 — PASS. | Claude routine |
| 2026-05-29 | @anthropic-ai/claude-agent-sdk 0.3.156 | Patch releases 0.3.154–0.3.156; “What’s new” heading updated to v0.3.156; three patch bullets added; comprehensive guide header updated; revision history entry added. All 25 exports verified against installed @anthropic-ai/claude-agent-sdk@0.3.156 (/tmp/npm-check-0529); query, tool, createSdkMcpServer, session helpers all PASS. Export count: 25 — PASS. | Claude routine |
| 2026-05-28 | @anthropic-ai/claude-agent-sdk 0.3.153 | Patch release 0.3.153; no API changes. Latest: header updated 0.3.152 → 0.3.153; revision history entry added. npm @anthropic-ai/claude-agent-sdk@0.3.153 confirmed latest (2026-05-28); export surface unchanged at 25 symbols. | Claude routine |
| 2026-05-27 | @anthropic-ai/claude-agent-sdk 0.3.152 | Patch releases 0.3.151–0.3.152; “What’s new” heading updated to v0.3.152; two patch bullets added; comprehensive guide header updated; revision history entry added. npm @anthropic-ai/claude-agent-sdk@0.3.152 confirmed latest. Export surface unchanged at 25 symbols. | Claude routine |
| 2026-05-23 | @anthropic-ai/claude-agent-sdk 0.3.150 | Patch releases 0.3.149–0.3.150; “What’s new” heading updated to v0.3.150; two patch bullets added; comprehensive guide header updated; revision history entry added. All 25 exports verified against installed @anthropic-ai/claude-agent-sdk@0.3.150 (.routine-envs/check-0523-node); query, tool, createSdkMcpServer, session helpers all PASS. Export count: 25 — PASS. | Claude routine |
| 2026-05-22 | @anthropic-ai/claude-agent-sdk 0.3.148 | Patch releases 0.3.146–0.3.148; “What’s new” heading updated to v0.3.148; three patch bullets added; comprehensive guide header updated; revision history entry added. All 25 exports verified against installed @anthropic-ai/claude-agent-sdk@0.3.148 (.routine-envs/check-0522-node); query, tool, createSdkMcpServer, session helpers all PASS. Export count: 25 — PASS. | Claude routine |
| 2026-05-20 | @anthropic-ai/claude-agent-sdk 0.3.145 | Patch release bump 0.3.144 → 0.3.145; “What’s new” heading updated to v0.3.145; v0.3.145 bullet added; comprehensive guide header updated; revision history entry added. All 25 exports verified against installed @anthropic-ai/claude-agent-sdk@0.3.145 (.routine-envs/check-0520-node); query, tool, createSdkMcpServer, session helpers all PASS. | Claude routine |
| 2026-05-19 | @anthropic-ai/claude-agent-sdk 0.3.144 | Major version bump 0.2.141 → 0.3.144; “What’s new” updated; comprehensive guide header updated; revision history entry added. Three unstable_v2_* exports removed from public API. Full 25-export surface verified against installed @anthropic-ai/claude-agent-sdk@0.3.144 (.routine-envs/check-0519-node). | Claude routine |
| 2026-05-14 | @anthropic-ai/claude-agent-sdk 0.2.141 | Version bumped 0.2.140 → 0.2.141; “What’s new” updated; comprehensive guide header updated; revision history entry added. Full export surface verified against installed @anthropic-ai/claude-agent-sdk@0.2.141 (.routine-envs/check-0514-node): 28 exports confirmed including query, tool, createSdkMcpServer, session helpers, error types, and constants. | Claude routine |
| 2026-05-13 | @anthropic-ai/claude-agent-sdk 0.2.140 | Version bumped 0.2.139 → 0.2.140; “What’s new” updated; comprehensive guide header updated; revision history entry added. Runtime exports (query, tool, createSdkMcpServer) verified against installed @anthropic-ai/claude-agent-sdk@0.2.140 (.routine-envs/check-0513-node). | Claude routine |
| 2026-05-12 | @anthropic-ai/claude-agent-sdk 0.2.139 | Version bumped 0.2.138 → 0.2.139; “What’s new” updated; revision history entry added. Runtime exports (query, tool, createSdkMcpServer) verified against installed @anthropic-ai/claude-agent-sdk@0.2.139 (.routine-envs/check-0512-node). | Claude routine |
| 2026-05-09 | @anthropic-ai/claude-agent-sdk 0.2.138 | Version bumped 0.2.128 → 0.2.138 (ten patch releases 0.2.129–0.2.138); “What’s new” updated; all exports verified against npm @anthropic-ai/claude-agent-sdk@0.2.138 (2026-05-09, .routine-envs/check-0509-node). | Claude routine |
| 2026-05-05 | @anthropic-ai/claude-agent-sdk 0.2.128 | Version bumped 0.2.126 → 0.2.128 (two patch releases: 0.2.127, 0.2.128); “What’s new” updated; revision history entry added. query (runtime export), PermissionMode/McpServerConfig (TypeScript type exports in sdk.d.ts) verified against npm @anthropic-ai/claude-agent-sdk@latest (0.2.128, 2026-05-05, .routine-envs/check-0505-node). | Claude routine |
| 2026-05-01 | @anthropic-ai/claude-agent-sdk 0.2.126 | Version bumped 0.2.123 → 0.2.126 (two patch releases: 0.2.124, 0.2.126; 0.2.125 not published); “What’s new” section updated for 0.2.124–0.2.126 patch series. Version confirmed against npm @anthropic-ai/claude-agent-sdk@latest (0.2.126, 2026-05-01). | Claude routine |
| 2026-04-29 | @anthropic-ai/claude-agent-sdk 0.2.123 | Version bumped 0.2.121 → 0.2.123 (two patch releases: 0.2.122, 0.2.123); “What’s new” section updated for 0.2.122–0.2.123 patch series. Version confirmed against npm. | Claude routine |
| 2026-04-28 | @anthropic-ai/claude-agent-sdk 0.2.121 | Version bumped 0.2.119 → 0.2.121 (two patch releases); “What’s new” section updated for 0.2.120–0.2.121 patch series. Version confirmed against npm. | Claude routine |
| 2026-04-24 | @anthropic-ai/claude-agent-sdk 0.2.119 | Version bumped 0.2.117 → 0.2.119; “What’s new” section updated for 0.2.118–0.2.119 patch series. | Claude routine |
| 2026-04-22 | @anthropic-ai/claude-agent-sdk 0.2.117 | Version bumped 0.2.116 → 0.2.117; “What’s new” section updated; revision history entries added for 0.2.111–0.2.117 patch series. | Claude routine |
| 2026-04-21 | @anthropic-ai/claude-agent-sdk 0.2.116 | Minimal example rewritten after pkg introspection: new Agent(...) does not exist; use query() / session helpers. Banner bumped to 0.2.116. | — |
| 2026-04-18 | @anthropic-ai/claude-agent-sdk 0.2.113 | Stability fixes; SDK rename stabilised. | — |
| 2025 | — | Renamed from @anthropic-ai/claude-code-sdk to @anthropic-ai/claude-agent-sdk. | — |
Note: Python implementation lives at Claude Agent SDK (Python).