85 agentic tools audited for security incidents · Talk to the lab →
MotionticBook a call
Tool explainer

What is the Claude Agent SDK?

The Claude Agent SDK is Anthropic's Python and TypeScript library that runs Claude Code's agent loop, built-in file, shell and web tools, and context management inside a team's own application.

Checked

Anthropic offers three ways to build an agent on Claude. The Client SDK calls the API and leaves the loop to the team. Claude Managed Agents hosts the harness on Anthropic's side. The Claude Agent SDK sits between the two: it embeds the same tools, agent loop and context management that power Claude Code in a process the team operates.

Until 29 September 2025 it was called the Claude Code SDK. Anthropic renamed it because the harness had begun to power most of its own major agent loops, not only coding. Older tutorials still import claude-code-sdk or @anthropic-ai/claude-code; current code imports claude-agent-sdk in Python and @anthropic-ai/claude-agent-sdk in TypeScript.

How it works

A call to query() starts the loop. Claude reads the prompt, picks a tool, reads the result and decides the next step, until the task is done or an error stops it. The SDK handles orchestration, tool execution, context management and retries, and streams each message back as it happens. Under the hood it runs a native Claude Code binary, which both packages bundle on supported platforms.

  • Built-in tools

    Read, Write, Edit, Bash, Glob, Grep and web search, so the agent acts on files and shells without the team writing those tools.

  • Permissions and hooks

    An allowed-tools list and permission modes decide what runs without approval. Hooks run custom code at key points in the loop, such as before or after a tool call.

  • Subagents and MCP

    Subagents take focused subtasks in their own context. MCP servers connect databases, browsers and internal APIs.

  • Sessions, skills and plugins

    Sessions can be resumed or forked. Skills, commands and memory load from the project's .claude/ folder and the user's ~/.claude/, as in Claude Code, and plugins package them for reuse.

Version and status, checked 1 November 2026

  • Versions

    Python claude-agent-sdk 0.2.176 and TypeScript @anthropic-ai/claude-agent-sdk 0.3.316, both released 31 October 2026. Both are still pre-1.0. Python 3.10 or Node.js 18.14 or later is required.

  • Adoption

    8,396 GitHub stars on the Python repo and 1,854 on the TypeScript repo, and 8.09M PyPI downloads in the week to 1 November 2026. Downloads include CI runs, so they are a relative signal, not a user count.

  • Licence

    Use is governed by Anthropic's Commercial Terms of Service, including when the agent powers a product sold to the team's own customers, except where a component's own LICENSE file says otherwise. That is not an OSI open-source licence.

  • Model access

    An Anthropic API key, or Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform or Microsoft Foundry, each switched on by an environment variable. Third-party products may not offer claude.ai login or its rate limits unless Anthropic has approved it.

When to pick it, and when not to

  • Pick it for

    Agents that work over files and shells, such as coding, research, document and operations agents, where Claude models pass the team's evals and the team wants Claude Code's tested context management instead of writing a loop.

  • Pick Managed Agents instead when

    The team does not want to run the process and sandbox itself. Claude Managed Agents has been in public beta since 8 April 2026 and bills token rates plus $0.08 per session-hour.

  • Pick the Client SDK instead when

    The agent is a short tool-calling loop over a few APIs. Anthropic's own guidance since December 2024 is to start with the API directly and add a framework only when it earns its place.

  • Look elsewhere when

    Steps must route across several model vendors, or procurement requires an OSI open-source licence. A model-neutral runtime such as LangGraph or Google ADK fits that job.

Gotchas from production

  • It ships a binary, not only a library

    Installs that skip npm optional dependencies (npm ci --omit=optional), or pip installs that fall back to a source distribution such as on ARM64 Windows, get no bundled binary and fail at start. Container builds need to account for that.

  • Configuration loads from disk

    Skills, commands and memory are read from .claude/ folders, as in Claude Code. A server deployment should control which of those folders exist at runtime, so a production agent does not inherit a developer's personal skills or memory.

  • Permission modes are not a sandbox

    acceptEdits and a broad allowed-tools list auto-approve actions. Anthropic's own fix for approval fatigue is filesystem and network isolation, which it reported cut permission prompts by 84% internally.

  • No .env loading

    The SDK reads the API key from the process environment and does not load .env files, a frequent cause of 'Not logged in' errors in new deployments.

  • Branding rules

    A product built on the SDK may use 'Claude Agent' or '<Name> Powered by Claude', but not 'Claude Code' or visuals that mimic it.

How Motiontic approaches it

Motiontic's engineers are vendor-neutral. They run a short spike on the client's real task before committing to a framework or store, keep prompts, tool definitions and evals outside the framework so a later switch is a refactor rather than a rewrite, and hand the eval suite to the client's team so the next tooling decision can be measured rather than argued.

Claude Agent SDK and its nearest alternatives, checked 1 November 2026

Claude Agent SDK and its nearest alternatives, checked 1 November 2026
Claude Agent SDKOpenAI Agents SDKLangGraph
What it isClaude Code's agent loop as a libraryLightweight framework for agents and multi-agent workflowsLow-level runtime for graph-shaped agents
ModelsClaude, via Anthropic, AWS, Google Cloud or Microsoft FoundryOpenAI Responses and Chat Completions; other LLMs through beta adaptersAny model the team connects
Built-in toolsFiles, shell, web search, subagentsFunction tools, MCP, OpenAI hosted tools, sandbox agentsNone; the team wires tools in
LicenceAnthropic Commercial Terms of ServiceMITMIT
Latest version0.2.176 Python, 0.3.316 TypeScript (31 Oct 2026)0.24.0 Python (15 Oct 2026), 0.21.0 JS (20 Oct 2026)1.2.19 Python (30 Oct 2026)
Hosted optionClaude Managed Agents (beta)OpenAI Agents API (beta)LangChain and Google managed runtimes
PyPI downloads, week to 1 Nov 20268.09M4.45M13.60M

Common questions

Is the Claude Agent SDK the same as Claude Code?

It runs the same agent loop, tools and context management as Claude Code, packaged as a Python and TypeScript library that bundles the Claude Code binary. Claude Code is the interactive terminal product; the SDK embeds the loop in an application.

Is the Claude Agent SDK free and open source?

The packages are free to install and model usage is billed as normal Claude API tokens. Use is governed by Anthropic's Commercial Terms of Service, which is not an OSI open-source licence.

Can the Claude Agent SDK use models other than Claude?

It is built for Claude. The supported providers (Anthropic, Amazon Bedrock, Claude Platform on AWS, Google Cloud and Microsoft Foundry) all serve Claude models.

What is the difference between the Claude Agent SDK and Claude Managed Agents?

The SDK runs the harness in a process the team operates. Managed Agents runs it on Anthropic's side, with sessions in an Anthropic cloud sandbox or a self-hosted sandbox, for token rates plus $0.08 per session-hour.

What was the Claude Agent SDK called before?

The Claude Code SDK. Anthropic renamed it on 29 September 2025 and publishes a migration guide from the old packages.

Running agents that have to hold up?

Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.