Claude Agent SDK
The Claude Agent SDK is Anthropic’s official SDK for building agents on Claude, providing session management, tool use, subagents, and hooks out of the box.
In plain English
The Claude Agent SDK (formerly marketed as the Claude Code SDK) is the library Anthropic maintains for developers building agents on Claude. It handles the things you would otherwise reinvent — multi-turn session state, tool definition and execution, subagent orchestration, file and shell access, hooks that let you gate or observe tool calls, and streaming output. You focus on the product logic; the SDK handles the loop.
Why it matters: earlier agent stacks were DIY. You hand-rolled the turn loop, managed history compaction yourself, invented your own subagent protocol. The SDK consolidates the patterns that worked and ships them as primitives. It also tracks Anthropic's newer capabilities — prompt caching, structured outputs, long-context handling — so your agent gets the upgrades without a rewrite.
Why it matters for Black Box
Black Box is built on the Claude Agent SDK. The CEO loop lives in apps/engine/src/ceo/ and wraps the SDK's session interface. Every specialist runs as a subagent under that session. When Anthropic ships a new SDK feature (better caching, hooks, structured output), Black Box picks it up with minimal changes.
Examples
- Spawning a specialist as a subagent with its own system prompt and tool allowlist.
- Registering a pre-tool-use hook that blocks any tool call matching a policy.
- Streaming NDJSON events from the SDK out to the browser for a live Action Feed.