Development & infrastructureAnthropic

Decision matrix

Claude Agent SDK app decision matrix
Overview

The Claude Agent SDK is a free Python and TypeScript library that runs the same agent loop, tools and permissions as Claude Code, inside a process you write and operate. It's for developers building an agent into their own application, not for chatting with Claude or running one-off terminal tasks. You pay only for the underlying API tokens the agent uses.

Other good fits
  • A team building a product where the agent needs to read files, run commands or call MCP tools as part of a larger service.
Pros
Read pros

The Agent SDK is a library, not a hosted service: it runs the Claude Code binary inside your own Python or TypeScript process, giving you the same built-in tools (read, write, edit files, run commands, search the web), permissions, sessions, hooks, subagents and MCP support that power Claude Code itself. You write the surrounding application; the SDK supplies the agent loop.

Pick it when…

  • You're building a product that needs an agent, something that plans its own steps and calls tools, not just a single answer.
  • You want the exact capabilities of Claude Code (skills, memory, subagents, MCP) available as a library inside your own process.
  • You're comfortable operating the process yourself, since this isn't a hosted API call.
Cons
Read cons

An agent that can read, write and run commands can also make a mistake with the same authority; scope its permissions to what the task actually needs, especially the first few times you run it. Anthropic doesn't allow third-party products built on the SDK to offer claude.ai login or claude.ai rate limits, so plan on API-key billing, not a flat subscription, for anything you build.

Pick something else when…

  • You want a single request-response call, not an agent that plans its own steps. The Claude API directly is simpler and cheaper for that.
  • You want to use Claude interactively from a terminal without embedding anything in your own app. Claude Code is built for exactly that.
  • You'd rather Anthropic host and run the agent loop than operate the process yourself. Managed Agents (part of the Claude API) does that.

Avoid if

  • You want Anthropic to host and run the agent for you; Managed Agents does that instead of you operating the process.
Workflow

Install the SDK for Python or TypeScript, set your Claude API key → configure the tools, permissions and any MCP servers the agent should have access to → give it a task and let it plan and execute its own steps → use hooks to intervene at key points, and sessions to resume or fork a run → review what the agent actually did, since it can edit files and run commands on its own.

Cost

The SDK itself is free; you pay only for the underlying Claude API tokens the agent consumes as it works (see the Claude API review for current per-model rates). An agent that plans, reads files and retries can use meaningfully more tokens than a single chat message, so budget for that difference, especially with a capable model on a long-running task. The operating effort is real: you own the process, its permissions configuration, and reviewing what the agent changes, since nothing here is sandboxed by Anthropic on your behalf unless you separately use Managed Agents' self-hosted sandbox option.

Restrictions

Use of the SDK is governed by Anthropic's commercial terms, including when it powers a product you sell to your own customers. Branding rules restrict how you can refer to Claude in your product ("Claude Agent" is allowed; "Claude Code" branding is not, and your product must not appear to be an Anthropic product).

First project

Documentation-based suggestion — not run here.

Follow the SDK's own quickstart: build a small agent that finds and fixes a bug in a short piece of existing code you don't mind it touching. Give it read and edit access to that one file or folder only, not your whole project, while you learn how its permissions model behaves.

Done when the agent identifies the actual bug (not an invented one), makes a change you can review line by line, and you understand which of its actions needed your approval versus which ran automatically.

Links & evidence
Documentation-based · not hands-on · Sep 23, 2026

Rests on Anthropic's Agent SDK overview and quickstart documentation, read on 2026-09-23. No agent was built or run with the SDK for this review.

  • Agent SDK overview · Sep 23, 2026 — Library that runs Claude Code's agent loop; capability table; licensing and branding rules.
  • Agent SDK quickstart · Sep 23, 2026 — First-agent walkthrough: finding and fixing a bug.
  • Claude API pricing · Sep 23, 2026 — Token pricing the SDK bills against, since the SDK itself has no separate fee.
Further review notes & alternatives
Catalogue facts

Build custom agents in Python or TypeScript with tools and context management. Choose it when an application needs its own Claude-based agent loop. Its SDK shape lets you add domain workflows such as protocol checking.

Anthropic · byok · cloud

  • autonomous agents
  • agent loop
  • function calling
  • context management
  • python sdk
  • typescript sdk
  • tool integration
  • custom workflow
  • protocol checker
  • build-app
  • automate
  • write-code
View sourced image

Claude Agent SDK

Press Escape to close.

Final frame of Anthropic's official Claude Agent SDK Simple Chat App demonstration (frame 525 of 526, zero-based index). The React and Express companion app displays the SDK-backed response and sources; the SDK itself has no standalone GUI. This is the publisher's recorded run, not a locally executed model call.

Anthropic Claude Agent SDK demos — Simple Chat App

Owner-requested editorial use of an official public interface image, 18 September 2026. Copyright remains with the original publisher; attribution preserved. No open licence, current plan entitlement or independent execution is asserted. Source asset: https://raw.githubusercontent.com/anthropics/claude-agent-sdk-demos/main/simple-chatapp/demo.gif. Complete image/frame converted to PNG without overlays or content changes.

Original image source (opens in a new tab)

Browse all tools