Claude Agent SDK
open sourceThe Claude Code harness as a library: built-in file, shell, and search tools, subagents, hooks, and permissions.
Directory
An agent framework gives you the loop: call the model, execute the tools it asks for, feed the results back, repeat until it stops. Around that sit state management, retries, structured output validation, and hooks for evaluation.
The honest starting position is that you may not need one. Provider SDKs now ship tool runners that handle the loop, and a first agent is often a hundred lines you fully understand. A framework pays off when you need orchestration the loop does not give you — branching workflows, durable state across restarts, multi-agent handoff — or when a team needs one shape to build against.
The cost is indirection. When an agent misbehaves you are debugging your prompt, your tools, and the framework's idea of how they fit together. Pick one whose abstractions you could reimplement if you had to.
6 tools · 6 open source · 6 self-hostable
| Tool | Best for | Pricing | Runs |
|---|---|---|---|
| Claude Agent SDKopen source | Filesystem- and shell-shaped agents where the built-in tool set is most of what you need. | Open source | Self-hosted |
| LangChainopen source | Projects that benefit from breadth of integrations, and teams who want explicit stateful graphs via LangGraph. | Open source | Hosted or self-hosted |
| LlamaIndexopen source | Retrieval-heavy applications where document ingestion and indexing are the hard part. | Open source | Hosted or self-hosted |
| Pydantic AIopen source | Python teams already using Pydantic who want type safety and a framework small enough to hold in your head. | Open source | Self-hosted |
| DSPyopen source | Tasks with a measurable metric and enough examples to optimise against, where hand-tuned prompts keep drifting. | Open source | Self-hosted |
| Mastraopen source | TypeScript and Node teams who want a framework designed for their stack instead of a translated one. | Open source | Hosted or self-hosted |
The Claude Code harness as a library: built-in file, shell, and search tools, subagents, hooks, and permissions.
The most widely used orchestration library, with LangGraph for explicit stateful agent graphs.
Data framework focused on ingestion, indexing, and retrieval pipelines feeding a model.
Agent framework from the Pydantic team, built around typed, validated model outputs.
Treats prompts as parameters to be optimised against a metric instead of hand-tuned strings.
TypeScript agent framework with workflows, memory, and evals in one package.
Most of this category is Python-first. If your service is TypeScript, the shortlist is genuinely shorter, and a thin layer over the provider SDK is often better than a half-maintained port.
Some frameworks give you primitives you compose; others give you an agent you configure. The second is faster to a demo and harder to debug at depth. Match this to how much novel behaviour you expect to need.
A long agent run will be interrupted. Whether the framework can resume from a checkpoint — or expects you to hold state yourself — decides how much infrastructure you write around it.
Anything shipped needs regression testing against a dataset. Frameworks that treat evals as part of the loop save you wiring an observability tool in later, though a dedicated tool will go deeper.
Often not. Provider SDKs include tool runners that drive the agent loop, and a first agent built directly on one is small and completely legible. Reach for a framework when you need orchestration, durable state, or a shared shape across a team.
A tool runner automates one loop: request, execute tools, feed results back, repeat. A framework adds what surrounds the loop — workflow branching, persistence, memory, retrieval, and evaluation.
Fewer than in Python. Several major libraries ship a JavaScript or TypeScript package, and a couple are TypeScript-first. Check which is actually maintained rather than merely published.
Tooling choices rarely dominate a bill; the model does. Compare model prices per million tokens or price your own workload before optimising anything here.