Skip to main content
Home/Blog/Claude Agent SDK: What It Is and the June 15 Billing Change
Developer Tools

Claude Agent SDK: What It Is and the June 15 Billing Change

The Claude Agent SDK lets you build autonomous agents on the same engine as Claude Code. Here's what it does, how to use it, and what the June 15, 2026 separate billing pool means for your costs.

By Sean

If you have ever wished you could take the autonomous engine behind Claude Code — the part that reads your files, runs your commands, edits code, and decides what to do next — and drop it straight into your own application, that is exactly what the Claude Agent SDK is for. It packages Claude Code's agent loop, built-in tools, and context management as a library you call from Python or TypeScript.

There are two reasons to care about it right now. First, it is genuinely the fastest way to build a production agent that works directly on your filesystem and services. Second, the economics changed: starting June 15, 2026, Agent SDK usage on Claude subscription plans is billed from a new, separate credit pool. If you run anything automated on a Pro or Max plan, that date matters. This guide covers both.

What the Agent SDK actually is (and the rename)

The Agent SDK is Anthropic's official library for building agents that autonomously read files, run commands, search the web, and edit code. It gives you "the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript," in Anthropic's words.

It used to be called the Claude Code SDK. On September 29, 2025, alongside the stable 1.0 release, Anthropic renamed it to the Claude Agent SDK. The rename reflects reality: the harness built for coding agents turned out to be just as good for deep research, data synthesis, legal assistants, finance advisors, SRE bots, and security reviewers. The package names changed with it — claude-code-sdk became claude-agent-sdk (Python), and @anthropic-ai/claude-code became @anthropic-ai/claude-agent-sdk (TypeScript).

Why use it instead of the raw API

The Anthropic Client SDK gives you direct API access: you send prompts and implement tool execution yourself. That means writing and maintaining the loop that detects a tool call, runs it, feeds the result back, and repeats until the model is done:

# Client SDK: you implement the tool loop
response = client.messages.create(...)
while response.stop_reason == "tool_use":
    result = your_tool_executor(response.tool_use)
    response = client.messages.create(tool_result=result, **params)

The Agent SDK hands you that loop already built, plus a working set of tools (Read, Write, Edit, Bash, Glob, Grep, WebSearch, WebFetch, and more). You describe the task; Claude handles execution:

# Agent SDK: Claude handles tools autonomously
async for message in query(prompt="Fix the bug in auth.py"):
    print(message)

If your agent's value is in what it accomplishes on your machine rather than in a custom tool runtime you have built, the Agent SDK removes most of the boilerplate.

Who it's for, where it runs, and how you authenticate

The SDK ships in Python (3.10+) and TypeScript. The TypeScript package bundles a native Claude Code binary for your platform as an optional dependency, so you do not install Claude Code separately.

You authenticate with an Anthropic API key from the Console, or route through Amazon Bedrock, Claude Platform on AWS, Google Vertex AI, or Microsoft Azure AI Foundry via environment variables. One important constraint for anyone shipping a product: Anthropic does not, unless previously approved, allow third-party developers to offer claude.ai login or subscription rate limits to their own end users — build customer-facing products on API-key authentication.

For surface comparison: the Claude Code CLI is best for interactive development and one-off tasks, while the SDK is the right tool for CI/CD pipelines, custom applications, and production automation. And if you would rather Anthropic run the agent loop and the sandbox for you, Managed Agents is a hosted REST alternative — many teams prototype with the Agent SDK locally, then graduate to Managed Agents for production.

How to use it: install, run, extend

Install:

# TypeScript
npm install @anthropic-ai/claude-agent-sdk
# Python
pip install claude-agent-sdk
export ANTHROPIC_API_KEY=your-api-key

A minimal TypeScript agent that uses built-in tools:

import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "Find all TODO comments and create a summary",
  options: { allowedTools: ["Read", "Glob", "Grep"] }
})) {
  if ("result" in message) console.log(message.result);
}

From there, the same capabilities that make Claude Code powerful are available:

  • Subagents — spawn specialized agents to handle focused subtasks. You define them with their own instructions and tool set; the main agent delegates and they report back. Invocations run through the Agent tool, so add Agent to your allowed tools to auto-approve them.
  • MCP — connect external systems (databases, browsers, APIs) via the Model Context Protocol. Point the SDK at an MCP server like Playwright and your agent gains browser automation.
  • Sessions — maintain context across exchanges. Capture a session ID, then resume later or fork it to explore different approaches without losing the conversation history.
  • Hooks — run your own code at lifecycle points (PreToolUse, PostToolUse, SessionStart, Stop, and others) to validate, log, block, or transform behavior.
  • Permissions — pre-approve safe tools, block dangerous ones, or require approval for sensitive actions.

It also reads Claude Code's filesystem configuration — CLAUDE.md project memory, .claude/skills/, slash commands, and plugins — so workflows you already use in the CLI translate directly.

What the June 15 billing change means

Here is the part to act on. Anthropic announced on May 14, 2026 that, effective June 15, 2026, programmatic Claude usage on subscription plans moves out of your interactive usage pool and into a separate Agent SDK credit.

What draws from the new credit pool:

  • The Claude Agent SDK (direct calls)
  • The claude -p headless command
  • Claude Code GitHub Actions
  • Third-party apps authenticated through the Agent SDK (including Agent Client Protocol integrations such as Zed and JetBrains)

The monthly credit amounts, billed at standard API rates:

PlanMonthly Agent SDK credit
Pro$20
Max 5x$100
Max 20x$200
Team (per user)$20

Three things to internalize. Credits do not roll over — they refresh each billing cycle and unused balance is lost. Interactive usage is unaffected — terminal Claude Code sessions and claude.ai chat stay on your existing plan limits; only automated workloads move. And there is no automatic fallback: when the credit runs out, additional Agent SDK usage only continues if you have explicitly enabled usage credits (overflow billing). Otherwise automated requests simply stop until the next cycle.

The reasoning is straightforward. Programmatic loops could previously run at interactive subscription pricing — an effective subsidy of roughly 15–30x against API rates. Separating the pools prices automation at what it actually costs. If you have been running agents, GitHub Actions, or scheduled claude -p jobs against your Pro or Max subscription, estimate your monthly token spend now (our Claude Code pricing breakdown and guide to AI coding rate limits help), and decide before June 15 whether the bundled credit covers you or whether a dedicated API key on pay-as-you-go is the cleaner path.

The bottom line

The Claude Agent SDK is the most direct way to put Claude Code's autonomous engine inside your own software — built-in tools, subagents, sessions, MCP, and hooks, in Python or TypeScript, with no tool loop to maintain. It is the same product as the old Claude Code SDK, renamed in September 2025 to match how broadly teams use it. The thing that genuinely changes on June 15, 2026 is the bill: Agent SDK and claude -p usage on subscription plans now spends a separate, non-rolling monthly credit ($20 Pro, $100 Max 5x, $200 Max 20x). Interactive work is untouched. If automation is part of your workflow, map your usage to that credit before the date arrives so nothing stops mid-pipeline.

Frequently Asked Questions

Find answers to common questions

The Claude Agent SDK is a Python and TypeScript library that lets you build AI agents on the same agent loop, built-in tools, and context management that power Claude Code. Your agent can autonomously read files, run commands, search the web, and edit code without you writing the tool-execution loop yourself.

Yes. Anthropic renamed the Claude Code SDK to the Claude Agent SDK on September 29, 2025, alongside the 1.0 release, to reflect that teams build far more than coding agents with it. The Python package changed from claude-code-sdk to claude-agent-sdk, and the TypeScript package from @anthropic-ai/claude-code to @anthropic-ai/claude-agent-sdk.

Starting June 15, 2026, Agent SDK and claude -p usage on subscription plans draws from a new monthly Agent SDK credit, separate from your interactive usage limits. The change also covers Claude Code GitHub Actions and third-party apps authenticated through the Agent SDK.

The monthly Agent SDK credit is $20 on Pro, $100 on Max 5x, and $200 on Max 20x, billed at standard API rates. Team plans get $20 per user. The credit refreshes each billing cycle and unused credit does not roll over.

No. Interactive Claude Code sessions in the terminal and claude.ai chat stay on your existing subscription usage limits. Only programmatic and automated usage — the Agent SDK, claude -p, GitHub Actions, and Agent SDK-authenticated apps — moves to the new credit pool.

The Agent SDK ships in Python (3.10 or later) and TypeScript. The TypeScript package bundles a native Claude Code binary as an optional dependency, so you do not need to install Claude Code separately.

With the Anthropic Client SDK you call the API directly and implement the tool-execution loop yourself. The Agent SDK gives you Claude with the tool loop already built in — Claude reads files, runs commands, and edits code autonomously, so you describe the task instead of orchestrating each step.

No. Agent SDK credits refresh monthly with your billing cycle and do not accumulate. When the credit runs out, additional usage only continues if you have enabled usage credits (overflow billing at standard API rates); otherwise automated requests stop until the next cycle.

Building Something Great?

Our development team builds secure, scalable applications. From APIs to full platforms, we turn your ideas into production-ready software.