The Claude Agent SDK is a toolkit that lets developers build their own AI agents on the exact engine that runs Claude Code. An agent, here, means an AI that can take action on its own: read files, run commands, search the web, and edit things, not just answer a question. Instead of building all of that machinery from scratch, you get Claude Code's tools, its decision loop, and its safety controls as a library you drop into your own software. It was previously called the Claude Code SDK and has been renamed, so the current name is the Claude Agent SDK.

What the Claude Agent SDK is

Think of Claude Code as a finished product: you type, and it reads files, runs commands, and gets work done. The Claude Agent SDK is the same capability, but opened up so your team can wire it into your own app, script, or workflow. It comes in two flavors, one for TypeScript (the language behind most modern web apps) and one for Python (common in data and automation work). You give it a prompt and a list of tools it's allowed to use, and it runs the whole back-and-forth on its own until the task is done.

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

The TypeScript package. The Python one installs with pip install claude-agent-sdk. Click to copy.

Why it matters: the plumbing is already built

If you wanted to build a tool-using agent the hard way, you'd have to write the loop yourself: ask the model what to do, run the action it asks for, hand the result back, ask again, and repeat until it's finished. That loop is the fiddly, error-prone part. The Claude Agent SDK handles it for you. You describe the job; Claude reads, runs, edits, and reports back on its own.

You giveA prompt + allowed toolsPlain-English instructions and a short list of what the agent may touch, like reading files or running commands.
It runsThe agent loopClaude decides the next step, takes the action, checks the result, and keeps going, all without you re-typing anything.
You getA finished resultThe work done and a report back, streamed step by step so you can watch what happened.

What you can build with it

The SDK ships with the same built-in tools that make Claude Code useful, so an agent can start working right away without you wiring up each action. You choose which ones to switch on for any given agent.

built-in tools
RRead, Write, EditOpen files, create new ones, and make precise edits.
$BashRun terminal commands, scripts, and git operations.
QGrep & GlobFind files by pattern and search their contents.
WWebSearch & WebFetchLook things up on the web and pull in page content.

You pass an allowed-tools list, and the agent can only use what you switch on.

On top of those, the SDK carries over the parts that make Claude Code more than a chatbot: MCP connectors to reach outside systems like databases and browsers, subagents to hand focused work to a specialist helper, a permission system so you control exactly which actions are allowed, and sessions so an agent remembers earlier context across multiple exchanges.

A real example: a support-triage agent

Say your team gets a flood of support requests and someone spends the first hour of every day sorting them. You could build a small agent with the SDK that does the sorting for you. You give it a prompt ("read each new ticket, tag it by topic, flag anything urgent, and draft a first reply") and switch on just the tools it needs. It reads the tickets, checks your knowledge base, and writes drafts, then hands the queue back to a human already sorted.

triage-agent
# the agent runs on its own once you start it reading new tickets 18 found tagging by topic flagging urgent items 3 flagged drafting first replies done

The same shape works for plenty of internal jobs: an agent that formats and files weekly reports, one that keeps two systems in sync, or one that reviews incoming documents against a checklist. The point is that you reuse Claude Code's engine instead of rebuilding the hard parts yourself.

Good to know: the Claude Agent SDK runs inside your own software and needs an Anthropic API key to work. It's a builder's tool, meant for a developer to put together, not something you type commands into like Claude Code itself.

When to reach for it (and when not to)

Reach for the SDK when you want the power of Claude Code baked into something of your own that runs without a person driving it: a scheduled job, a step in a pipeline, or a feature inside your product. If you just want to get work done at your keyboard, day to day, the Claude Code command line is the simpler choice. Many teams use both, the command line for hands-on work and the SDK for the parts they want to run on their own.