Catalog / Tools

Claude Agent SDK

Anthropic's Python and TypeScript libraries for building your own agents on the same loop, tools, permissions and MCP support that run Claude Code.

Install

  1. Python

    pip install claude-agent-sdk

    Python 3.10+. Bundles the Claude Code CLI. The SDK is free, but its model calls bill to your API key or Claude plan.

  2. TypeScript

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

The agent loop behind Claude Code, as a library. You get file, shell and web tools, subagents, hooks, permission callbacks and in-process MCP servers. You supply the prompt, the tool policy and whatever custom tools your agent needs.

When to use it

  • You want an agent in your own app, script or CI job rather than in a terminal session.
  • You need custom tools, as plain Python or TypeScript functions exposed over MCP.
  • You want control over every tool call through can_use_tool or hooks.

Before you build

Decide the tool policy first. Use disallowed_tools to take away tools the agent shouldn’t have, and allowed_tools only for tools that are safe to run without asking. Don’t use permission_mode="bypassPermissions" outside a sandbox.

Publisher
Anthropic
Works with
Claude Code, Any agent
Categories
Agent building
License
MIT (Python); Anthropic Commercial Terms (TypeScript)
Cost
Paid

Curated by Andrew Borden-Chisholm. Notes on building with these tools are on the blog.