ClaudeMap

Claude Agent SDK

Anthropic's official TypeScript SDK for building agentic applications.

SDKs & Toolingofficialsdktypescriptanthropic

The same engine that powers Claude Code, packaged as a typed SDK for orchestrating tools, sub-agents, and long-running workflows.

What it does

  • query() async-generator API — iterate the message stream (assistant text, tool calls, tool results)
  • ClaudeAgentOptions: allowed_tools / permission_mode / cwd / model / hooks / mcp_servers / max_turns / max_budget_usd
  • MCP server wiring (stdio + HTTP/SSE) merged with project-level .mcp.json
  • Hooks system — PreToolUse / PostToolUse / Stop / SubagentStop, with audit logging via async iteration
  • Driven by the bundled Claude Code CLI — inherits all built-in tools, context management, and permission model

When to use it

Best for production agents that need the Claude Code loop programmatically — CI / CD pipelines, background workers, custom applications, and multi-agent orchestration via asyncio.gather. Pairs naturally with any TypeScript framework that talks async iterators; the SDK is the canonical production surface.

Getting started

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

Requires the Claude Code CLI on PATH and ANTHROPIC_API_KEY (or equivalent provider env) set. The SDK runs the CLI under the hood; both must be present.

Things to know

Pin to a major version — the SDK's TypeScript types evolve between minor releases. Long-running batch workloads should use the streamed async iteration pattern; the sync helpers can block the event loop. Always set max_turns and max_budget_usd in production.

Repository

anthropics/claude-agent-sdk-typescript

Charted

Related on the map

  • E2B

    SDK / Tool

    Open-source secure sandboxes where AI agents run code — the de facto execution layer for agent apps.

    • sandbox
    • code-execution
    • sdk
    • agents
  • FastMCP

    SDK / Tool

    Pythonic framework for building MCP servers — decorators, type hints, and zero boilerplate.

    • framework
    • python
    • mcp
    • type-driven