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

  • Harness Bridge

    SDK / Tool

    A local launcher that points Claude Code and seven other coding harnesses at any OpenAI-, Anthropic- or Responses-compatible endpoint — without editing a single config file.

    • launcher
    • local-models
    • cli
    • menu-bar
  • Claude for Siri

    SDK / Tool

    Answers macOS Spotlight and Siri prompts with your signed-in Claude Code account — an experimental macOS 27 model-delegation provider.

    • macos
    • siri
    • spotlight
    • model-delegation
  • Extract your own local chat history from ten AI coding assistants into one normalized JSONL — for fine-tuning, analytics, or backing up years of conversations. Standard library only.

    • cli
    • data-export
    • jsonl
    • backup