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.
Direct answer
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.
Best for
Developers comparing real tool tradeoffs before choosing a stack.
Covers
Verdict, tradeoffs, pricing signals, workflow fit, and related alternatives.
Read next
The 2026 agent decision is not CrewAI vs LangGraph. It is whether your loop lives in vendor infrastructure, a self-hosted graph runtime, or a plain while-loop you wrote yourself. Here is how to choose.
9 min readClaude 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 readApache Burr hit the front page of Hacker News with 142 points today. Here is what it actually does, how it compares to LangGraph and CrewAI, and when you should skip frameworks entirely.
9 min readLast updated: June 11, 2026
"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.
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.
| 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 |
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.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
From the archive
Jun 11, 2026 • 8 min read
Jun 11, 2026 • 8 min read
Jun 11, 2026 • 10 min read
Jun 11, 2026 • 8 min read
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.
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.
Both libraries are free to use. The bills arrive from different directions.
With the Claude Agent SDK you pay Claude token costs: Sonnet 4.6 at $3 input / $15 output per million tokens, Opus 4.8 at $5/$25, Fable 5 at $10/$50, with cache reads at 0.1x input price, per Anthropic's pricing page. The harness leans on prompt caching aggressively, which matters for long agent loops. One notable change: starting June 15, 2026, Agent SDK and claude -p usage on subscription plans draws from a separate monthly Agent SDK credit - $20 on Pro, $100 on Max 5x, $200 on Max 20x - that does not eat your interactive limits, per Anthropic's support article. API key users 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.
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 new subscription credit makes prototyping nearly free if you already pay for Pro or Max.
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.
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.
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.
The library itself is free under Anthropic's Commercial Terms of Service; you pay for Claude tokens. From June 15, 2026, subscription plans include a separate monthly Agent SDK credit ($20 Pro, $100 Max 5x, $200 Max 20x) so SDK usage does not consume interactive limits. API key usage bills at standard per-token rates.
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.
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.
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.
Technical 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.
Anthropic's agentic coding CLI. Runs in your terminal, edits files autonomously, spawns sub-agents, and maintains memory...
View ToolAnthropic's first generally available Mythos-class model, released June 9, 2026. 1M context, 128K max output, $10/$50 pe...
View ToolAnthropic's recommended default for complex work, released May 28, 2026. 1M context, 128K output, $5/$25 per million tok...
View ToolAnthropic's Python SDK for building production agent systems. Tool use, guardrails, agent handoffs, and orchestration. R...
View ToolEvery coding agent in one window. Stop alt-tabbing between Claude, Codex, and Cursor.
View AppTurn a one-liner into a working Claude Code skill. From idea to installed in a minute.
View AppDesign subagents visually instead of editing YAML by hand.
View AppDeep comparison of the top AI agent frameworks - LangGraph, CrewAI, Mastra, CopilotKit, AutoGen, and Claude Code.
AI AgentsA practical walk-through of how to design, write, and ship a Claude Code skill - from choosing when to trigger, through allowed-tools, to the steps the agent will actually follow.
Getting StartedConfigure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
AI Agents
Claude Fable 5 Released: Benchmarks, Pricing, Availability, and Real-World Examples Anthropic has released Claude Fable 5, the first general-use “Mythos class” model, and the video reviews the announ...

Nimbalyst Demo: A Visual Workspace for Codex + Claude Code with Kanban, Plans, and AI Commits Try it: https://nimbalyst.com/ Star Repo Here: https://github.com/Nimbalyst/nimbalyst This video demos N...

Claude Design by Anthropic: Generate a Design System From Your Repo + Build High-Fidelity UI Fast The video reviews Claude Design by Anthropic, calling it a highly differentiated product, and demonst...
The 2026 agent decision is not CrewAI vs LangGraph. It is whether your loop lives in vendor infrastructure, a self-hoste...
Claude Agent SDK vs Claude Code explained: same engine, two surfaces. Here is the concrete decision line, plus where Man...
Apache Burr hit the front page of Hacker News with 142 points today. Here is what it actually does, how it compares to L...
Claude Managed Agents is in public beta with solid sandboxing and session persistence - but the headline orchestration f...
Both Mastra and LangGraph.js are serious TypeScript agent frameworks - but they start from opposite philosophies. Here i...
A practical comparison of OpenAI's Agents SDK and Anthropic's Claude Agent SDK - orchestration models, tool ecosystems,...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.