Claude Agent SDK vs LangGraph for Production Routing in 2026
Claude Agent SDK vs LangGraph in 2026: routing, checkpointing, failures, and fleet cost — an operator's verdict, version-pinned to 0.2.138 and 1.2.11.
Most comparisons of these two stop at a feature matrix. That is the wrong layer. By August 2026, both the Claude Agent SDK and LangGraph are credible production tools, and the interesting question is no longer which one has more checkboxes. It is: where does the routing decision live — in your code, or in the model's context window? That single distinction predicts which framework will survive your failure modes, your audit requirements, and your invoice.
The short verdict: use LangGraph (1.2.11) when routing must be deterministic, checkpointed, and auditable across model providers. Use the Claude Agent SDK (0.2.138) when the work is open-ended, Claude-native, and you want the thinnest possible orchestration layer. Large fleets run both, on different workload classes. We do.
Version pins, verified against PyPI and GitHub at time of writing: claude-agent-sdk 0.2.138 (released 2026-08-13) and langgraph 1.2.11 (released 2026-08-11), with langgraph-checkpoint 4.2.0, langgraph-checkpoint-postgres 3.1.2, and langgraph-checkpoint-sqlite 3.1.1. Every claim below refers to those versions.
What each one actually is
The two are frequently described as competitors. They are built on opposite primitives.
The Claude Agent SDK is, in Anthropic's own packaging, the "Python SDK for Claude Code" — the agent loop that powers Claude Code, exposed as a library. One agent, a tool set, a context window, and a loop that runs until the task is done. Its routing is emergent: the model decides which tool to call next based on the conversation state. It speaks MCP natively and inherits Claude Code's permission hooks and sandboxing.
LangGraph is a graph execution engine. You declare typed state, nodes, and conditional edges; the framework executes the graph, checkpoints state at every step, and resumes from any checkpoint. Its routing is declared: you wrote the branch logic before deployment. Since the 1.x line stabilized, it has shipped on a conventional release cadence — 1.2.11 arrived August 11, 2026 with checkpoint-library updates and a new trace_policy hook on add_node for observability control.
| Dimension | Claude Agent SDK 0.2.138 | LangGraph 1.2.11 |
|---|---|---|
| Core primitive | Agentic loop (model-driven) | State graph (code-driven) |
| Routing owner | The model, per step | Your conditional edges |
| Model support | Anthropic models | Any provider via LangChain adapters |
| Runtime | Claude Code runtime | Your process, your infra |
| Release shape | 0.x, near-daily (0.2.131→0.2.138 in one August week) | 1.x semver, weekly-to-monthly |
| License | MIT | MIT |
One asymmetry worth staring at: the SDK is still a 0.x package with roughly 140 releases behind it and a cadence that can ship two versions in a day. That is velocity, and it is also dependency churn — pin the version and treat upgrades as changes, not patches.
Routing model: deterministic graph vs agent-driven loop
This is the decision that compounds.
In LangGraph, a routing rule like "escalate to a human if confidence is below 0.3" is a conditional edge — plain Python, unit-testable, identical on every execution. In the Agent SDK, the same rule lives in a prompt and is enforced by the model's willingness to follow it. Both work in a demo. In production they fail differently: the graph fails loudly and reproducibly (you got the edge wrong, and you can replay it); the loop fails silently and probabilistically (the model routed correctly 98% of the time, and nobody logged the 2%).
We run both patterns. Our multi-agent research stack runs twelve agents on a LangGraph StateGraph with approval gates — the keyword "deploy" or "database" forces a human checkpoint, every time, because it is an edge in the graph, not a suggestion in a prompt. That determinism is why graph orchestration remains the default for anything that touches money or production systems.
The loop earns its place elsewhere. For open-ended work — research, code changes, synthesis — the cost of pre-declaring every branch exceeds the value of determinism. The model is a better router than any graph you would hand-write for a task neither of you can fully specify in advance. Anthropic's engineering position is consistent with this: the SDK exists to make the harness thin and let the loop do the work, with Claude Code itself as the runtime — a design others in the field have flagged as the SDK's defining trait.
Latency is not the deciding factor, though we have measured it. On a four-node decision loop with a single LLM call in the middle, our instrumentation logged roughly 130 ms of framework overhead for the Agent SDK path versus roughly 450 ms for the LangGraph path (state serialization and checkpoint writes included). Both are noise next to a 2,000 ms model call. Choose on control semantics, not milliseconds.
State and checkpointing
| Capability | Claude Agent SDK 0.2.138 | LangGraph 1.2.11 |
|---|---|---|
| Durable checkpoints | No built-in equivalent | First-class: Postgres, SQLite, Redis savers |
| Crash recovery | Session resumption; you build persistence | Resume any thread from any checkpoint |
| Time-travel replay | No | Yes — replay from a checkpoint with modified state |
| State model | Context window + session history | Typed state schema with custom reducers |
| Human-in-the-loop | Permission callbacks / hooks | Native interrupt() / resume |
This is the widest gap in the comparison. LangGraph's checkpoint layer is a genuine durable-execution substrate: a long-running workflow that dies mid-flight restarts from its last checkpoint with full state, and any past execution can be replayed for debugging or audit. Nothing in the Agent SDK compares. The SDK's state story is the context window — powerful, but volatile. If your process dies, you are re-reading transcripts and rebuilding state yourself.
The corollary: checkpoint writes are a tax the SDK does not pay. For short, high-volume scheduled tasks, that is an advantage, not a gap.
Failure modes: retries, fallbacks, circuit breakers
Neither framework ships a real circuit breaker. Write that on the wall before choosing either.
Where they differ is blast radius. The Agent SDK gives you retry, timeout, and cost controls inside one provider's stack — which is exactly as durable as that provider. "API Error: 529 Overloaded" trending on Hacker News is what single-provider routing looks like at fleet scale: your retry policy is retrying into the same wall.
LangGraph routes through provider-agnostic adapters, and LangChain's with_fallbacks() gives you cross-provider failover — primary model outages fail over to a second vendor, not a second attempt at the first. Escalation to humans is native: an interrupt() pauses the graph, state checkpointed, and resumes when the decision lands. In the SDK, the equivalent is a permission callback that blocks the loop — workable, but the durability of the pause is your problem.
Our own trajectory illustrates the trade. We moved scheduled (cron-class) workloads — roughly 80% of our agent invocations — onto the Agent SDK after Anthropic's April 2026 billing change closed the subscription-proxy loophole. The SDK's built-in retry, timeout, and cost controls retired an entire class of custom watchdog processes. That is a real operational win, and it came with a real concentration risk we now manage with fallback routing outside the SDK.
Cost profile at fleet scale
The framework is a rounding error; the loop is the invoice. Our April 2026 cost audit found per-token prices down roughly 85% from 2024 while total spend went up — because agent workloads became loops of 5–15 model calls per decision over exploded context windows. Cheap tokens plus unbounded loops equals higher bills.
What each framework does about that:
| Cost lever | Claude Agent SDK 0.2.138 | LangGraph 1.2.11 |
|---|---|---|
| Loop bounds | Built-in turn/timeout limits | Recursion limits per graph run |
| Per-stage spend control | Cost controls in SDK loop | Per-node model choice — cheap models on cheap nodes |
| Provider arbitrage | None (single vendor) | Native — route each node to the cheapest capable model |
| Retry spend | Bounded by SDK controls | Bounded by per-node retry policy |
| Checkpoint overhead | None | Serialization + storage per superstep |
The structural difference: LangGraph makes model-tier routing a graph design decision (signal node on a cheap model, judgment node on a strong one), while the SDK makes it a loop design decision (subagents, tool selection, context discipline). Both work; only one of them survives a compliance ask to show the routing table.
When each is the wrong choice
Choose against yourself honestly:
- The Agent SDK is the wrong choice when you need multi-provider routing, durable mid-workflow state, or an auditable answer to "why did the system take this path?" A 0.x release cadence is also a liability for teams that cannot pin and test.
- LangGraph is the wrong choice when the work is a single open-ended task, your team already lives in the Claude ecosystem (hooks, MCP tooling, Code runtime sandboxing), or graph ceremony would outnumber your actual branches. A five-node graph around one LLM call is bureaucracy, not architecture.
The verdict
| Workload | Pick |
|---|---|
| Deterministic pipelines, approvals, money-adjacent paths | LangGraph 1.2.11 |
| Multi-provider fleets with failover requirements | LangGraph 1.2.11 |
| Open-ended Claude-native work (research, code, synthesis) | Claude Agent SDK 0.2.138 |
| High-volume scheduled tasks, single vendor acceptable | Claude Agent SDK 0.2.138 (pin the version) |
| Both workload classes at scale | Both — split by workload, not by team preference |
The framework does not route your traffic. It decides who owns routing — your code or the model's judgment — and every downstream property (auditability, recovery, blast radius, bill) follows from that one choice. We cover the wider field in AutoGen vs LangGraph for enterprise and our framework comparison benchmarks; the design principles that survive either choice are in 12-factor agents, and the evaluation side in the agent evaluation inflection.
You built it. We optimize it — including the routing table.
FAQ
Is the Claude Agent SDK production-ready in 2026? For Claude-native, open-ended workloads: yes, with two caveats — pin the version (0.2.138 as of 2026-08-13; the 0.x line moves near-daily) and accept single-provider concentration risk. It lacks durable checkpointing; scheduled and fleet workloads need external state management.
Does LangGraph support Anthropic models? Yes. LangGraph 1.2.11 is provider-agnostic through LangChain adapters, including Anthropic. This is the cleanest architectural split: LangGraph for the graph and failover, Claude models inside the nodes.
Which is cheaper at fleet scale? Framework overhead is negligible on both (tens to hundreds of milliseconds, no per-call fee). Spend is driven by loop structure and model-tier routing. LangGraph's per-node model choice gives it a structural edge for tiered routing; the SDK's built-in loop/cost controls give it an edge for unattended scheduled work.
Can you run both together? Yes, and at scale you probably should. A common 2026 pattern: LangGraph as the deterministic outer graph — checkpoints, approvals, failover — with Agent SDK loops as heavyweight nodes for open-ended subtasks.