If your team already uses Claude Code, the Claude Agent SDK is the shortest path to putting the same agent inside your own product or pipeline. The interesting part is subagents: small specialists the main agent can send off on focused jobs.
The SDK was renamed from the Claude Code SDK and gives you the same tools, agent loop and context management that power Claude Code, in Python and TypeScript. Its use is governed by Anthropic's Commercial Terms (Anthropic, 2026).
1. What you get
| Feature | What it does |
|---|---|
| Built-in tools | Read, write and edit files, run commands, search the web |
| Permissions | Decide which tools run automatically and which need approval |
| Subagents | Separate agents for focused subtasks; only their final message comes back |
| Hooks | Your code runs when a tool is called or a session starts or stops |
| MCP | Connects external tools and data through an open standard |
2. A small demo: a read-only reviewer
Install with pip install claude-agent-sdk and set ANTHROPIC_API_KEY.
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions, AgentDefinition
async def main():
async for message in query(
prompt="Review the authentication module for security issues",
options=ClaudeAgentOptions(
allowed_tools=["Read", "Grep", "Glob", "Agent"],
agents={"code-reviewer": AgentDefinition(
description="Code review specialist for quality and security.",
prompt="You are a code review specialist.",
tools=["Read", "Grep", "Glob"], model="sonnet")})):
if hasattr(message, "result"):
print(message.result)
asyncio.run(main())
The reviewer can read and search, but it has no write tool, so it cannot change your code. That is the habit I would keep everywhere: give each subagent the fewest tools its job needs. Our free subagent templates follow the same rule, and the Anthropic code recipe covers plain API calls.
3. Two settings to get right on day one
Permissions. One mode, bypassPermissions, is documented
as "use with extreme caution", because the agent then has full system access
(Anthropic, 2026). Keep it out of anything that touches production.
Budget. A subagent can spawn subagents of its own, and spend has no
limit unless you set max_budget_usd (Anthropic, 2026). Set it before the
first real run, and log what each run cost.
Are you ready to ship an agent on it?
Score each 0 (no), 1 (partly) or 2 (yes):
- Narrow tools: every subagent lists only the tools it needs.
- Budget cap:
max_budget_usdis set and monitored. - No bypass: nothing in production runs with bypassed permissions.
- Hooks: risky tool calls are logged or blocked by a hook.
- Terms read: someone has read the Commercial Terms for your use.
| Score | Next move |
|---|---|
| 8–10 | Pilot it on one internal workflow. |
| 5–7 | Fix permissions and budget first. |
| 0–4 | Keep it on a developer laptop for now. |
Your next step
Run the reviewer on one repository this week with a small budget cap, and compare its findings with your last human review.
Sources
- Anthropic (2026). Agent SDK overview. Read 20 November 2026.
- Anthropic (2026). Subagents in the SDK. Read 20 November 2026.
- Anthropic (2026). Handling permissions. Read 20 November 2026.
- Anthropic (2026). Migrate to Claude Agent SDK. Read 20 November 2026.