The Claude Agent SDK is a development kit provided by Anthropic for building AI agents. It is a framework for implementing agents in Python and TypeScript that leverage Claude's Tool Use and multi-turn conversation capabilities.
Directly calling the Claude API to build agents is possible, but it requires implementing the same boilerplate every time: loop processing to return tool call results to the model, error handling, and guardrail configuration. The Claude Agent SDK is an official framework that abstracts this "agent loop," allowing developers to focus on business logic.
Agent development requires integrating LLM instructions (system prompts), external tool definitions, and execution result evaluation into a single loop. A naive implementation—appending tool return values to the message history, calling the model again, evaluating the termination condition, and so on—can balloon to hundreds of lines of code.
The SDK condenses this loop into the Agent class. Developers simply define tools as functions and pass them to the Agent. Loop control, token management, and switching between serial and parallel tool execution are all handled by the SDK.
The core of the SDK is the Agent object. Instantiate it by passing a name, instructions (system prompt), and tools (list of tools), then execute it with Runner.run().
1from agents import Agent, Runner, function_tool
2
3@function_tool
4def get_weather(city: str) -> str:
5 return f"The weather in {city} is sunny."
6
7agent = Agent(
8 name="weather-bot",
9 instructions="When asked about the weather, retrieve it using the tool and respond.",
10 tools=[get_weather],
11)
12
13result = Runner.run_sync(agent, "What's the weather in Tokyo?")Tool inputs and outputs are automatically converted to JSON Schema from type annotations, eliminating the need to write schemas by hand. When I first tried this, my impression was that this automatic conversion alone cut the traditional boilerplate by more than half.
To guard against unintended agent behavior, guardrails for inputs and outputs can be configured declaratively. Constraints such as "reject inputs containing personal information" or "retry if the response does not conform to a specific format" can be embedded as part of the agent definition.
There is also a "handoff" feature for coordinating multiple agents. This is a mechanism by which one agent passes control to another mid-process—for example, a first-line customer support agent that detects a technical question and hands it off to a specialist agent. This kind of multi-agent configuration can be achieved without explicit orchestration code.
The SDK natively supports connections to MCP (Model Context Protocol) servers. Tool sets exposed by MCP servers can be dynamically added to an Agent's tool list, allowing external capabilities such as database operations and file system access to be incorporated directly into the SDK's agent loop. This means you can replicate in your own agents the same mechanism that Claude Code uses to operate Supabase via an MCP server.
Claude Code is a CLI-based coding agent officially provided by Anthropic, and the Claude Agent SDK is used in its internal implementation. In other words, the SDK is positioned as "the building block for creating your own agents like Claude Code." The definition of Agent Skills and the tool execution flow also conform to the SDK's architecture.
That said, the SDK itself is a general-purpose framework and can handle use cases beyond coding—such as sales support, data analysis pipelines, and internal chatbots—using the same design patterns.



Claude Code is a terminal-resident AI coding agent developed by Anthropic. It is a CLI tool that enables users to consistently perform codebase comprehension, editing, test execution, and Git operations through natural language instructions.

OpenClaw is an open-source personal AI agent framework that runs in a local environment, featuring long-term memory, autonomous task execution, and self-generating skill capabilities, which surpassed 160,000 stars on GitHub in 2026.

An AI agent is an AI system that autonomously formulates plans toward given goals and executes tasks by invoking external tools.

Agent Skills are reusable instruction sets defined to enable AI agents to perform specific tasks or areas of expertise, functioning as modular units that extend the capabilities of an agent.

A2A (Agent-to-Agent Protocol) is a communication protocol that enables different AI agents to perform capability discovery, task delegation, and state synchronization, published by Google in April 2025.