← Bookmarks 📄 Article

Building agents with the Claude Agent SDK \ Anthropic

Anthropic discovered their coding tool's architecture works for any agent task—the secret is giving Claude a computer (terminal access) instead of just APIs, enabling it to work like humans do through an iterative loop of gathering context, taking action, and verifying work.

· ai ml
Read Original
Listen to Article
0:008:55
Summary used for search

• The Claude Agent SDK (formerly Claude Code SDK) gives agents terminal access to work like humans—using bash, writing code, and iterating—rather than just calling APIs
• Agent design follows a loop: gather context (agentic search, subagents, file systems) → take action (tools, bash, code generation, MCPs) → verify work (linting, visual feedback, LLM judges)
• File system structure becomes "context engineering"—Claude uses grep/tail to selectively load large files into context
• Code generation is ideal for agents because it's precise, composable, and reusable (e.g., Claude.AI's file creation writes Python scripts for Excel/PowerPoint)
• Subagents enable parallelization and context isolation—spin up multiple agents for different queries, return only relevant excerpts

Anthropic built Claude Code as a coding tool but discovered it powers far more—research, video creation, customer support. The core insight: giving Claude computer access (terminal, file system) rather than just APIs enables human-like problem-solving. They're renaming it the Claude Agent SDK to reflect this broader capability.

The SDK implements a specific agent loop: gather context → take action → verify work → repeat. For context gathering, agents use agentic search (bash commands like grep to selectively load files), subagents (parallel workers with isolated context windows), and compaction (auto-summarization when approaching context limits). The file system itself becomes context engineering—folder structure determines what information could be pulled into context. For taking action, agents use tools (primary actions like fetchInbox), bash scripts (flexible work), code generation (precise, reusable outputs—Claude.AI's file creation writes Python for Office docs), and MCPs (standardized integrations for Slack, GitHub, etc.). For verification, agents use rules-based feedback (linting with detailed errors), visual feedback (screenshots for UI tasks), and LLM-as-judge for fuzzy evaluation.

The framework enables building finance agents (portfolio analysis with API access), research agents (searching document collections), customer support agents (handling ambiguous tickets), and more. The key is thinking about what tools your agent needs to complete its job, then testing failures to identify missing capabilities. Anthropic uses this architecture internally for almost all major agent loops, demonstrating it scales beyond toy examples.