# Claude Agent SDK

Claude Agent SDK is a harness option for building AI agents. The Claude Code loop as a library, for agents that are not about code.

## Facts

- Layer: Harness (What thinks)
- Vendor: Anthropic
- Licence: proprietary
- Pricing: usage based
- Self-hostable: no
- SDKs: ts, py
- Install: `npm install @anthropic-ai/claude-agent-sdk`
- Requires: `ANTHROPIC_API_KEY`
- Docs: https://docs.claude.com/en/api/agent-sdk/overview
- Last verified: 2026-08-21

## When to reach for it

- You are choosing a harness component — what thinks.
- You are happy to depend on a hosted service and would rather not operate this yourself.

## Worth knowing

Same harness as Claude Code, but you own the entrypoint and the tool surface.

## Alternatives in the harness layer

| Option | What it does | Licence | Self-host |
| --- | --- | --- | --- |
| Claude Code | Anthropic's coding agent — terminal, IDE and SDK, with hooks, skills and MCP built in. | proprietary | no |
| Hermes Agent | Self-improving agent from Nous Research — writes its own skills from experience and carries them forward. | open source | yes |
| OpenClaw | Self-hosted gateway putting an agent in Slack, Telegram, WhatsApp, Signal, Discord and iMessage at once. | open source | yes |
| Prime Agent | Prime Intellect's recursive-language-model harness — a persistent IPython kernel is the only tool, sub-agents are function calls. | open source | yes |
| DeepSeek Harness | Everything is a plugin — the model adapter, the tool registry, the sandbox and the agent loop itself are all swappable. | open source | yes |
| OpenAI Agents SDK | Lightweight loop with handoffs, guardrails and sessions. | open source | no |
| Codex CLI | OpenAI's terminal coding agent. | open source | no |
| OpenCode | Open-source terminal coding agent, provider-agnostic. | open source | yes |
| Goose | Block's open-source on-machine agent with an extension system. | open source | yes |
| Letta | Stateful agent server where memory is the primary abstraction. | open source | yes |
| Roll your own loop | No harness. A while-loop, a model call and your own tool dispatch. | open source | yes |

Head to head:

- https://newagent.build/compare/claude-agent-sdk-vs-claude-code
- https://newagent.build/compare/claude-agent-sdk-vs-hermes-agent
- https://newagent.build/compare/claude-agent-sdk-vs-openclaw
- https://newagent.build/compare/claude-agent-sdk-vs-prime-agent
- https://newagent.build/compare/claude-agent-sdk-vs-deepseek-harness
- https://newagent.build/compare/claude-agent-sdk-vs-openai-agents-sdk
- https://newagent.build/compare/claude-agent-sdk-vs-codex-cli
- https://newagent.build/compare/claude-agent-sdk-vs-opencode

## Curated stacks using it

- Customer-facing support agent: Talks to strangers, remembers them, and is assumed hostile-adjacent by default.
- Long-running operations agent: Runs for hours, survives deploys, and stops to ask a human before it spends money.
- Research analyst: Reads the whole internet, writes something with citations, runs code to check itself.
- Browser automation: Drives real web apps that have no API, on behalf of a specific signed-in user.

## Add it to a stack

```bash
curl -fsSL "https://newagent.build/api/stack?harness=claude-agent-sdk&format=sh" | sh
```

## Machine interfaces

- `GET https://newagent.build/api/registry` — every component as JSON
- `GET https://newagent.build/api/vendors` — vendors, with the repo and releases feed to watch
- `GET https://newagent.build/api/advise?q=<plain english>` — recommended stack for a description
- `GET https://newagent.build/api/stack?<layer>=<id>&format=sh|json|md|yml|agents|env` — a stack as files
- `GET https://newagent.build/llms.txt` — the whole registry in one fetch

Any page here also returns markdown if you send `Accept: text/markdown`.