LangGraph
OpenAI Agents SDK
The strongest durability and human-in-the-loop primitives of the three, with any model and an explicit loop you can audit
The shortest path to a multi-agent system with approvals and tracing, if your models come from OpenAI
- Per-step checkpoints
- interrupt() + resume
- Model-agnostic
- Python and JS
- Handoffs
- Serialisable approvals
- Built-in tracing
- More code up front
- No spend cap
- Beta adapters for other models
- No spend cap
Key Takeaways
- Claude Agent SDK — The harness behind Claude Code, in Python and TypeScript. Ships file, shell and web tools, hooks, permission modes, and both a turn cap and a dollar cap. Runs Claude models only.
- OpenAI Agents SDK — A light runner for agents, tools and handoffs. Approval gates pause a run into a serialisable state; tracing is built in. OpenAI models by default, others through beta adapters.
- LangGraph — You draw the loop as a graph. Checkpointers persist every step, interrupt() pauses for a human, and any model works. More code up front, the most control later.
- Bottom line — LangGraph for long-running, audited, multi-model workflows. OpenAI Agents SDK for OpenAI-stack agents with handoffs. Claude Agent SDK when you want a ready-made coding-style agent with tools included.
How do these three harnesses differ?
All three run the same basic cycle: call the model, execute the tools it requests, feed the results back, repeat until it stops. An agent harness is the code that owns that cycle. They differ in how much of the harness they hand you. The Claude Agent SDK gives you a finished one: Claude Code's loop, tools, permissions and context compaction as a library. The OpenAI Agents SDK gives you a thin runner and a few primitives (agents, tools, handoffs, guardrails) to compose. LangGraph gives you a graph runtime and expects you to draw the loop yourself.
That choice decides where the hard parts land: stop conditions, spend limits, approvals and recovery after a crash. Facts below are from each vendor's documentation as accessed on November 3, 2026. Versions on PyPI that day: claude-agent-sdk 0.2.177, openai-agents 0.24.0, langgraph 1.2.19.
How do they score?
Editorial 1-5 scores from published documentation, not benchmarks, on the four criteria that decide whether a loop is safe to run unattended. The same scores appear on each WTF Radar review.
| Harness | Loop control | Human-in-the-loop and durability | Observability | Portability | Total |
|---|---|---|---|---|---|
| Claude Agent SDK | 5/5 | 3/5 | 3/5 | 2/5 | 13/20 |
| OpenAI Agents SDK | 4/5 | 4/5 | 4/5 | 3/5 | 15/20 |
| LangGraph | 4/5 | 5/5 | 4/5 | 5/5 | 18/20 |
Feature comparison
Feature matrix
| Feature | Claude Agent SDK | OpenAI Agents SDK | LangGraph |
|---|---|---|---|
| Basics | |||
| What it is | Claude Code's agent loop as a library | Lightweight runner: agents, tools, handoffs | Low-level graph runtime for stateful agents |
| Languages | Python, TypeScript | Python, TypeScript | Python, JavaScript/TypeScript |
| License (PyPI package) | MIT; use governed by Anthropic Commercial Terms | MIT | MIT |
| Models | Claude only: Anthropic API, Bedrock, Google Cloud, Microsoft Foundry | OpenAI by default; LiteLLM and any-llm adapters in beta | Any model |
| Loop control | |||
| Turn cap | max_turns (default: no limit) | max_turns; raises MaxTurnsExceeded | Recursion limit on graph steps |
| Spend cap | max_budget_usd, includes subagents | Track usage yourself | Track usage yourself |
| Built-in tools | Read, Edit, Bash, Grep, WebSearch, subagents | Hosted web search, file search, code interpreter, MCP | Bring your own (LangChain integrations) |
| Intercept tool calls | PreToolUse / PostToolUse / Stop hooks | Run hooks, input and output guardrails | Any node or conditional edge |
| Humans and durability | |||
| Approval before an action | canUseTool callback, ask rules, permission modes | needs_approval per tool; run pauses with interruptions | interrupt() pauses a node |
| Resume later | Resume or fork sessions; external session store | Serialisable RunState | Checkpointer + thread ID |
| Crash-safe step persistence | Session transcripts; file checkpointing for rewinds | Caller-managed | Checkpoint per step (Postgres, SQLite) |
| Observability | |||
| Tracing | OpenTelemetry export; traces in beta | Built-in tracing to OpenAI; custom processors | LangSmith tracing |
When does the Claude Agent SDK fit?
Anthropic renamed the Claude Code SDK to the Claude Agent SDK in September 2025, describing the loop as "gather
context, take action, verify work, repeat". It is the most complete harness of the three out of the box: built-in
tools for files, shell, search and subagents, hooks before and after every tool call, six permission modes, and
automatic compaction when the context fills. It is also the only one with a dollar cap, max_budget_usd,
which counts subagent spend. Both caps default to no limit, so set them.
Claude Agent SDK
- The only one of the three with a dollar cap on the loop, and it covers subagents
- Tools for files, shell, search and subagents come built in, so a working agent is a few lines
- Layered permissions: hooks, deny and ask rules, permission modes, then your callback
- Claude models only
- Runs the Claude Code binary as a subprocess, which shapes how you host it
- Long-running, crash-safe workflows need a durable layer around it
When does the OpenAI Agents SDK fit?
The runner calls the model, ends on a final output, switches agent on a handoff, or runs tools and loops. Tools
marked needs_approval pause the run; you approve or reject, serialise the state if needed, and resume.
OpenAI's docs add a warning worth copying into any design review: approval "does not guarantee exactly-once
execution", so side-effecting tools need idempotency keys. Other model providers work through LiteLLM and any-llm
adapters that the docs label best-effort and beta.
OpenAI Agents SDK
- Small API surface: agents, tools, handoffs, guardrails, sessions
- Approval pauses produce a serialisable run state you can resume later
- Tracing is on by default and viewable in the OpenAI dashboard
- Non-OpenAI models run through adapters the docs call best-effort and beta
- No built-in spend cap
- Traces export to OpenAI unless you change the processor
When does LangGraph fit?
LangGraph reached 1.0 in October 2025 with durable state, built-in persistence and first-class human-in-the-loop
as the headline features. You define nodes and edges; a checkpointer saves state per thread; interrupt()
pauses a node and Command(resume=...) continues it. The loop bound is a recursion limit on graph steps,
which the docs say is usually hit by an infinite loop and sometimes by a large graph. It costs more code to start
and pays that back when a run must survive a restart or an auditor's questions.
LangGraph
- Explicit control over every step of the loop, which auditors can read
- Per-step checkpoints make resume after a crash or a multi-day approval routine
- Model-agnostic, in Python and JavaScript
- More code before the first agent runs
- No spend cap; the recursion limit is the only built-in loop bound
- Best tracing story runs through LangSmith, a separate LangChain product
Related questions
- Which agent orchestration frameworks are production-ready in 2026?
- How does LangGraph compare with CrewAI and Mastra?
- Which stop conditions and budgets should every agent loop have? (partner site CTAIO)
- What is the Ralph loop for coding agents? (partner site CTAIO)
- When does a deterministic workflow beat an agent? (partner site CTAIO)
Frequently asked questions
What is an agent harness?
An agent harness is the code that runs an AI agent's loop: it sends the task to the model, executes the tools the model asks for, feeds results back, manages context and permissions, and decides when to stop. The Claude Agent SDK, the OpenAI Agents SDK and LangGraph are three widely used harnesses, at different levels of abstraction.
Is the Claude Agent SDK the same as Claude Code?
It is the same agent loop, tools and context management packaged as a Python and TypeScript library. Anthropic renamed the Claude Code SDK to the Claude Agent SDK in September 2025 because teams were using it for agents beyond coding. The SDK runs a bundled Claude Code binary as a subprocess.
Can I use LangGraph with Claude or OpenAI models?
Yes. LangGraph is model-agnostic, so a LangGraph agent can call Claude, OpenAI or other models. The two vendor SDKs are tied more closely to their own models: the Claude Agent SDK runs Claude only, and the OpenAI Agents SDK supports other providers through adapters it describes as best-effort and in beta.
Which SDK is best for long-running agents?
LangGraph, if the run must survive restarts or wait days for an approval, because it checkpoints state at every step and resumes from a thread ID. The OpenAI Agents SDK can serialise a paused run and resume it. The Claude Agent SDK resumes sessions and caps turns and spend well, but crash-safe multi-day workflows need a durable layer around it.
How much do these SDKs cost?
All three libraries are free and MIT-licensed on PyPI; you pay for model usage. Use of the Claude Agent SDK is governed by Anthropic's Commercial Terms, and LangGraph's tracing runs through LangSmith, a separate LangChain product.
Final verdict
- Choose LangGraph if the agent runs for hours or days, must resume after failures or approvals, needs an auditable path, or must work across model vendors.
- Choose the OpenAI Agents SDK if you build on OpenAI models and want agents that hand off to each other, with approval pauses and tracing included.
- Choose the Claude Agent SDK if you standardise on Claude and want a working agent with file, shell and web tools, layered permissions and a spend cap, without building the harness.
Sources
- Anthropic, Building agents with the Claude Agent SDK (Sep 29, 2025); Claude Agent SDK docs: overview, agent loop, permissions, observability, quickstart.
- OpenAI Agents SDK docs: running agents, human-in-the-loop, models, tools.
- LangChain, LangChain and LangGraph 1.0 (Oct 22, 2025); LangGraph docs: interrupts, persistence, recursion limit, observability.
- PyPI package metadata for claude-agent-sdk, openai-agents and langgraph (accessed Nov 3, 2026).
Ready to Find the Right AI Tools?
Browse our data-driven rankings to find the best AI tools for your team.