Claude Agent SDK

Claude Agent SDK

Build autonomous AI agents powered by Claude

Features

  • Agentic loop with tool use and reasoning
  • Built-in file system, terminal, and web tools
  • Customizable system prompts and tool permissions
  • Streaming output with progress tracking

Pros

  • Production-ready agent framework from Anthropic
  • Deep integration with Claude's tool use capabilities
  • Battle-tested in Claude Code product

Cons

  • Tied specifically to Claude models
  • Python-only SDK currently
  • Still relatively new framework

Overview

The Claude Agent SDK is Anthropic’s framework for building autonomous AI agents powered by Claude. It provides the agentic loop infrastructure that powers Claude Code, enabling developers to build agents that can reason, use tools, and complete multi-step tasks autonomously.

The SDK handles the core agent loop: sending messages to Claude, parsing tool use requests, executing tools, and feeding results back. It comes with built-in tools for file system operations, terminal commands, and web browsing, while also supporting custom tool definitions.

This framework represents Anthropic’s production-ready approach to AI agents, built from the experience of developing and shipping Claude Code to millions of developers.

When to Use

Use the Claude Agent SDK when building autonomous agents that need to interact with tools, file systems, and external services. It is the right choice when you want a production-grade agent framework specifically optimized for Claude.

Getting Started

pip install claude-agent-sdk
from claude_agent_sdk import Agent

agent = Agent(
    model="claude-sonnet-4-5-20250929",
    tools=["filesystem", "terminal"],
    system_prompt="You are a helpful coding assistant."
)

result = agent.run("Create a Python script that processes CSV files")