This is an early release preview. You may encounter bugs.
Claude Agent SDK logo
Unclaimed

Framework coding

Claude Agent SDK

SDK that exposes the Claude Code agent loop for building custom agents.

Built by Anthropic

A 81/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
Discussion

01 / Summary

About Claude Agent SDK.

Claude Agent SDK is Anthropic's library for embedding the Claude Code agent loop in your own application. It gives a program the same built-in tools, agent loop, and context management that Claude Code uses, so an agent can plan its own steps and read files, run commands, edit code, and search the web. This entry is the Python package, and a TypeScript version is also available. The SDK runs the Claude Code binary, which ships bundled with the package.

There are two entry points. query() is an async function that sends a prompt and streams back response messages. ClaudeSDKClient supports bidirectional, interactive conversations and also accepts custom tools and hooks written as Python functions. Custom tools run as in-process MCP servers inside the application, so they need no separate process, and they can be combined with external MCP servers.

Hooks are functions that the Claude Code application, not the model, calls at fixed points in the agent loop to apply deterministic processing or automated feedback. Tool permissions are controlled with an allowlist of auto-approved tools, a blocklist, a permission mode, and a per-call callback. Other Claude Code capabilities carry over, including subagents, sessions that can be resumed or forked, skills, slash commands, memory, and plugins.

Anthropic positions it alongside its other options: the Claude Code CLI for interactive terminal use, the Client SDK for direct calls to the Claude API with a self-written tool loop, and Managed Agents for an agent harness hosted by Anthropic.

  • Claude Code agent loop: the same tools, loop, and context management as Claude Code, callable from Python
  • Built-in tools: read, write, and edit files, run shell commands, and search the web
  • Streaming queries: an async function that returns response messages as they arrive
  • Interactive client: bidirectional conversations with support for custom tools and hooks
  • In-process MCP tools: Python functions exposed as MCP tools without a separate server process
  • Hooks: deterministic code that runs at set points in the agent loop
  • Permissions: allowlists, blocklists, permission modes, and a per-call approval callback
  • Sessions and subagents: resume or fork sessions and spawn specialized subagents
  • Project configuration: loads skills, commands, memory, and plugins the same way Claude Code does
  • Typed errors and messages: typed message, content-block, and error classes

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

04 / Build

Build with Claude Agent SDK.

Browse the catalog for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get Claude Agent SDK →

Browse the catalog