Claude Agent SDK vs OpenAI Agents SDK vs LangGraph: Agent Harnesses Compared

Claude Agent SDK vs OpenAI Agents SDK vs LangGraph: Agent Harnesses Compared

Three ways to run an agent loop in production: Anthropic's Claude Agent SDK, OpenAI's Agents SDK and LangGraph, compared on stop conditions, budgets, human approval, durability, tracing and model lock-in. Scored, with a verdict.

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.

HarnessLoop controlHuman-in-the-loop and durabilityObservabilityPortabilityTotal
Claude Agent SDK5/53/53/52/513/20
OpenAI Agents SDK4/54/54/53/515/20
LangGraph4/55/54/55/518/20

Feature comparison

Feature matrix

Included Partial Not included Hover for details

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

Pros
  • 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
Cons
  • 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

Pros
  • 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
Cons
  • 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

Pros
  • 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
Cons
  • 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

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

Explore More

Ready to Find the Right AI Tools?

Browse our data-driven rankings to find the best AI tools for your team.