# Claude Agent SDK

> A kit that puts the Claude Code agent inside your own app.

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** Claude Code SDK, Anthropic Agent SDK

## Think of it like

It is like a top cook who comes to cook in your own home.

## Definition

The Claude Agent SDK is a library for Python and TypeScript that runs Claude Code's agent inside your own app. It gives your code the same tools, agent loop, permissions, sessions and hooks that Claude Code has. The SDK ships with a Claude Code binary and runs it for you. It used to be called the Claude Code SDK.

## Example

Mia's team wants a bot that fixes failing tests on every pull request. They build it with the Agent SDK instead of writing the tool loop themselves.

## Why it matters

Building an agent from scratch means writing the loop, the tools and the safety checks. The SDK hands you all three.

## Common mistake

Thinking it is the same as the client SDK for the API. That one sends single requests, and you write the loop.

## Three principles

- **Claude Code as a library.** Python or TypeScript.
- **Same loop and tools.** Same safety.
- **Runs a Claude Code process.** Bundled.

## Related terms

- [Agent Loop](https://learn.benibix.com/term/ai/agent-loop)
- [query() Function](https://learn.benibix.com/term/ai/query-function)
- [claude-agent-sdk Package](https://learn.benibix.com/term/ai/claude-agent-sdk-package)
- [Agent SDK](https://learn.benibix.com/term/development/agent-sdk)
- [Anthropic SDK](https://learn.benibix.com/term/development/anthropic-sdk)
- [Claude Managed Agents](https://learn.benibix.com/term/development/claude-managed-agents)
- [Claude Agent SDK Hosting](https://learn.benibix.com/term/ai/agent-sdk-hosting)

## Told apart from

- [Claude Managed Agents vs Claude Agent SDK](https://learn.benibix.com/compare/claude-managed-agents-vs-claude-agent-sdk): People think Claude Managed Agents and the Claude Agent SDK are the same, since both give you a ready-made Claude agent. The Agent SDK is a library. Its agent runs inside your own app, on your own machine or server. Managed Agents is a service in the Claude API. Its agent runs as a hosted session in a sandbox, and your app sends it events.

![Your app calls the Agent SDK, the SDK runs a Claude Code process, and that process talks to Claude and runs tools on your machine.](https://learn.benibix.com/diagrams/agent-sdk-architecture.svg)

---

Source: https://learn.benibix.com/term/ai/claude-agent-sdk
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
