Claude Agent SDK vs LangGraph: Choosing Your Agent Stack in 2026

TL;DR
Claude Agent SDK vs LangGraph head-to-head: architecture, state handling, multi-agent patterns, and real pricing - plus a decision guide for which agent stack fits your team in 2026.
Official Sources#
| Resource | Link |
|---|---|
| Claude Agent SDK Overview | code.claude.com/docs/en/agent-sdk/overview |
| LangGraph Overview | docs.langchain.com/oss/python/langgraph/overview |
| LangGraph Persistence | docs.langchain.com/oss/python/langgraph/persistence |
| LangSmith Pricing | langchain.com/pricing |
| Claude API Pricing | platform.claude.com/docs/en/about-claude/pricing |
| Agent SDK on Claude plans | support.claude.com |
| Monthly API credits for Max and Team | support.claude.com |
Last updated: October 17, 2026 (pricing and plan-credit sections re-verified against Anthropic's pricing page and help center)
"Claude Agent SDK vs LangGraph" looks like a framework beauty contest, but the two tools answer different questions. The Claude Agent SDK is the Claude Code engine packaged as a library: an opinionated, batteries-included harness where Anthropic owns the agent loop and you steer it. LangGraph is a low-level orchestration runtime where you own the loop, the state schema, and every edge in the graph - and it works with any model provider.
Both are production-grade in mid-2026. The choice comes down to how much of the agent you want to build versus inherit, whether Claude-only is acceptable, and where you want operational costs to land.
What each one actually is#
The Claude Agent SDK (npm install @anthropic-ai/claude-agent-sdk, pip install claude-agent-sdk, Python 3.10+) gives you, per Anthropic's docs, "the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript." The primary interface is query(): you pass a prompt and an allowedTools list, and the agent loop runs to completion. Built-in tools ship in the box - Read, Write, Edit, Bash, Glob, Grep, WebSearch, WebFetch, Monitor, and AskUserQuestion - so a working coding or research agent is a few lines, not a few sprints. The TypeScript package even bundles a native Claude Code binary so there is nothing else to install. It is governed by Anthropic's Commercial Terms of Service, not an open-source license, and in practice it runs Claude models only.
LangGraph (pip install -U langgraph, with a JS/TS sibling) describes itself as "a low-level orchestration framework and runtime for building, managing, and deploying long-running, stateful agents." You define a StateGraph with typed state, add nodes (plain functions), wire edges including conditional ones, compile, and invoke. There are no built-in file or shell tools; you bring your own. It is MIT-licensed, model-agnostic, and LangChain's site lists Klarna, LinkedIn, Uber, and Nvidia among its users. Notably, LangChain's own docs steer newcomers toward the higher-level LangChain agent module - LangGraph is positioned for teams that want low-level control.
Head-to-head#
| Claude Agent SDK | LangGraph | |
|---|---|---|
| What it is | Claude Code engine as a library | Graph orchestration framework + runtime |
| Who owns the loop | Anthropic's harness; the model decides next steps | You; the graph defines next steps |
| Languages | Python, TypeScript | Python, JavaScript/TypeScript |
| Models | Claude only (API, Bedrock, Vertex, Azure Foundry, Claude Platform on AWS) | Any provider |
| Built-in tools | Read, Write, Edit, Bash, Grep, WebSearch, WebFetch, and more | None; bring your own |
| State | Sessions as JSONL on your filesystem; resume and fork by session ID | Checkpointers (in-memory, SQLite, Postgres); threads, time travel, forking |
| Multi-agent | Subagents via AgentDefinition + the Agent tool | Any topology you can draw: supervisor, hierarchical, swarm |
| Lifecycle control | Hooks (PreToolUse, PostToolUse, Stop, etc.) + permission modes | You write the nodes, so control is total |
| License | Anthropic Commercial Terms of Service | MIT |
| Hosted deployment | Pair with Claude Managed Agents | LangSmith Deployment, hybrid, or self-hosted |
| Library cost | Free; you pay Claude tokens | Free; you pay tokens + optional LangSmith |
Architecture: who owns the loop#
This is the real fork in the road. With the Claude Agent SDK, the loop is prompt-driven: Claude reads the task, picks tools, recovers from errors, and compacts its own context. Your control surface is configuration - allowedTools, permission_mode, hooks that can log, block, or transform any tool call, and filesystem conventions Claude Code users already know (CLAUDE.md memory, .claude/skills/, MCP servers, plugins). You get an enormous amount of agent engineering for free, at the cost of the loop being a black box you steer rather than code you step through.
LangGraph inverts that. Nothing happens unless a node does it, and nothing transitions unless an edge allows it. That explicitness is why regulated and high-volume teams like it: every step is inspectable, testable, and replayable. It is also why the first week feels slower - you are implementing tool execution, retry policies, and context management that the Agent SDK ships as defaults. If you want the deeper "who should own your loop" framing, including the plain while-loop option, see our managed agents vs LangGraph vs DIY breakdown.
State handling: sessions vs checkpoints#
The Claude Agent SDK persists sessions as JSONL on your filesystem. Capture the session_id from the init message, pass resume later, and the agent continues with full context; you can also fork a session to explore alternatives. It is simple and good enough for most single-agent products, but the state is a conversation transcript, not a typed object you can query mid-run.
LangGraph treats state as the product. A checkpointer snapshots the typed graph state at every super-step, organized into threads by thread_id. Swap InMemorySaver for PostgresSaver and runs survive process restarts. You can replay from any checkpoint_id, fork alternate trajectories, and pick a durability mode (exit, async, sync) that trades write latency against crash recovery. A separate Store interface persists memory across threads with namespacing and semantic search. If your agent runs for hours, pauses for human approval, or must resume from step 7 of 12 after a deploy, this machinery is the whole reason LangGraph exists.
Honest read: LangGraph wins state handling on capability; the Agent SDK wins on how little of it you have to think about.
Multi-agent patterns#
The Agent SDK's multi-agent story is subagents. You define named agents programmatically (agents={"code-reviewer": AgentDefinition(...)}), include Agent in allowedTools, and the orchestrating Claude delegates and synthesizes results. Messages carry a parent_tool_use_id for tracing. It is an orchestrator-worker pattern: clean, traceable, and deliberately constrained - subagents report back to the caller rather than talking to each other.
LangGraph imposes no pattern at all. Supervisor trees, hierarchical teams, peer-to-peer handoffs, voting panels - if you can draw it as a graph, you can build it, and the shared state object is the communication channel. That freedom is genuine, and so is the design burden that comes with it. For the TypeScript-flavored version of this tradeoff, our Mastra vs LangGraph JS comparison covers how other frameworks package the same primitives.
Pricing implications#
Both libraries are free to use. The bills arrive from different directions.
With the Claude Agent SDK you pay Claude token costs. Per Anthropic's pricing page as of October 17, 2026, the current models are Claude Sonnet 5.5 at $2 input / $10 output per million tokens, Claude Opus 5.5 at $4/$20 and Claude Fable 5.1 at $10/$50, with Haiku 5.5 at $0.10/$0.50 for prompts up to 100,000 tokens. Cache reads cost 0.1x the input price on most models and 0.05x on Opus 5.5 and Sonnet 5.5, and the Batch API halves input and output prices. The harness leans on prompt caching aggressively, which matters for long agent loops.
The subscription story changed since this post was first written. The June 2026 plan to move Agent SDK and claude -p usage onto a separate monthly credit was paused on June 15, and the help-center article says usage signed in with your plan still draws from your subscription limits. As of October 7, Max and Team plans instead include monthly API credits: $100 on Max 5x, $200 on Max 20x, and $20 or $100 per seat on Team (pooled, capped at $500). They cover the Claude API, Managed Agents and the Agent SDK when you run it with an API key from the linked Console organization. Free, Pro and Enterprise plans are not eligible, and the credits do not roll over. API key users otherwise keep standard pay-as-you-go billing. Hosting is your problem, or Claude Managed Agents at standard token rates plus $0.08 per session-hour (our Managed Agents honest review covers that path).
With LangGraph you pay whatever your model provider charges - and being model-agnostic is itself a cost lever, since you can route steps to cheap models from any vendor. Self-hosting the runtime is free. The paid layer is LangSmith: a free Developer tier with 5,000 base traces per month (then $2.50 per 1,000), Plus at $39 per seat per month with one dev-sized deployment included, and managed deployments metered at $0.0007 per minute of uptime for dev and $0.0036 per minute for production, plus $0.005 per deployment run. None of it is mandatory, but most serious LangGraph teams end up paying for observability somewhere.
Persona decision guide#
Solo dev or small team shipping a Claude-based product fast: Agent SDK. The built-in tools, permissions, and session handling collapse weeks of harness work, and the monthly API credits on Max and Team plans can cover early prototyping, though Pro plans do not get them.
Platform team with multi-model requirements or vendor-risk rules: LangGraph. Claude-only is a hard architectural commitment with the Agent SDK; LangGraph lets you route per-step and renegotiate later.
Team building long-running, interrupt-heavy workflows (approvals, pauses, replays): LangGraph. Checkpoint-level resume, time travel, and durable execution modes are exactly this use case.
Team whose agent is fundamentally "Claude working in a repo or filesystem": Agent SDK. It is the Claude Code engine; nothing else matches it for coding-agent ergonomics. If you are weighing it against the CLI itself, see Claude Agent SDK vs Claude Code.
Team already on OpenAI's stack: neither answer here is complete - read our OpenAI Agents SDK vs Claude Agent SDK comparison first.
When to skip both#
Skip both if a single model call with the tool runner in the regular Anthropic client SDK does the job - classification, extraction, a two-tool lookup. An agent harness is overhead there. Skip both if you want zero infrastructure: Claude Managed Agents runs the loop and sandbox for you behind a REST API. And skip LangGraph specifically if you want a higher-level abstraction - LangChain's own docs now point beginners to the LangChain agent module, and frameworks like Mastra or the Vercel AI SDK cover the middle ground with less ceremony.
FAQ#
Claude Agent SDK vs LangGraph: which should I use for production agents?#
Use the Claude Agent SDK when your agent is Claude-centric and you want a proven harness with built-in tools, permissions, and sessions. Use LangGraph when you need explicit control over the execution graph, durable checkpointed state, custom multi-agent topologies, or the freedom to mix model providers. The Agent SDK gives you a finished loop; LangGraph gives you the materials to build one.
Is the Claude Agent SDK free to use?#
The library itself is free under Anthropic's Commercial Terms of Service; you pay for Claude tokens. Max and Team plans include monthly API credits ($100 to $200 on Max, $20 or $100 per seat on Team) that can pay for Agent SDK runs made with an API key from your linked Console organization. API key usage otherwise bills at standard per-token rates.
Can LangGraph use Claude models?#
Yes. LangGraph is model-agnostic, and Claude models work through the Anthropic integration (or Bedrock and Vertex). You get LangGraph's orchestration and persistence, but not the Agent SDK's built-in tools, context compaction, or Claude Code filesystem conventions - you implement those yourself.
Does the Claude Agent SDK work with non-Anthropic models?#
No. It is the Claude Code engine and runs Claude models, whether via the Claude API, Amazon Bedrock, Google Vertex AI, Microsoft Foundry, or Claude Platform on AWS. If multi-provider routing is a requirement, that alone decides the comparison in LangGraph's favor.
Is LangGraph open source?#
Yes, LangGraph is MIT-licensed and free to self-host in both Python and JavaScript. The paid products are LangSmith observability and LangSmith Deployment; both are optional.
Continue Reading#
- Claude Agent SDK - pricing, features, and alternatives on one page
- Best AI Agent Frameworks (2026) - LangGraph and the other frameworks, compared with code
Sources#
- Claude Agent SDK overview - code.claude.com (accessed June 11, 2026)
- LangGraph overview - docs.langchain.com (accessed June 11, 2026)
- LangGraph persistence - docs.langchain.com (accessed June 11, 2026)
- LangGraph product page - langchain.com (accessed June 11, 2026)
- LangSmith pricing - langchain.com (accessed June 11, 2026)
- Claude API pricing - platform.claude.com (accessed October 17, 2026)
- Use the Claude Agent SDK with your Claude plan - support.claude.com (accessed October 17, 2026)
- Monthly API credits for Max and Team plans - support.claude.com (accessed October 17, 2026)
Get the next comparison like this in your inbox
One email a week on ai-agents and the rest of the AI dev stack. Free.
Read next on Claude Code
Managed Agents vs LangGraph vs Rolling Your Own: Who Should Run Your Agent Loop in 2026
Managed agents vs LangGraph vs a DIY while-loop - compare state, sandboxing, cost, lock-in and compliance to decide who should run your agent loop in 2026.
9 min readThe TypeScript AI Agent Stack in Mid-2026: Mastra vs Vercel AI SDK vs OpenAI Agents SDK vs LangGraph.js
The TypeScript AI agent stack compared - Mastra, Vercel AI SDK, OpenAI Agents SDK and LangGraph.js, which layer each covers, and how to pick or combine them.
10 min readClaude Agent SDK vs Claude Code: When to Build and When to Drive
Claude Agent SDK vs Claude Code explained: same engine, two surfaces. Here is the concrete decision line, plus where Managed Agents fits as the hosted third option.
8 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.








