Core Concepts
Reasoning Techniques
Memory Systems
Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools & Products
Safety & Governance
Evaluation
Research
Development
Meta
Core Concepts
Reasoning Techniques
Memory Systems
Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools & Products
Safety & Governance
Evaluation
Research
Development
Meta
Claude Agent SDK is Anthropic's framework that exposes the same agent infrastructure powering Claude Code, enabling developers to build custom autonomous AI agents for specialized workflows. Released in 2025 alongside Claude 4, the SDK provides access to core tools, context management systems, permissions frameworks, and orchestration logic used in Anthropic's production agentic tools.
The SDK is backed by Claude Opus 4, Anthropic's most powerful model, capable of sustained performance on long-running tasks requiring thousands of steps over several hours.
Shared Infrastructure with Claude Code: The SDK uses the identical agent harness, tools, orchestration logic, and memory management that power Claude Code. This means developers get production-tested components rather than experimental abstractions.
Tool Use and Discovery: Agents can discover, learn, and execute tools dynamically through a semantic search mechanism. Instead of loading all available tools upfront, the agent searches for relevant ones — reducing context window usage and improving accuracy.
MCP Integration: Full support for the Model Context Protocol (MCP), enabling agents to connect to external data sources, APIs, and services through standardized MCP servers. This allows dynamic tool discovery across multiple integrations.
Context and Memory Management: Sophisticated context handling including automatic summarization when approaching input limits, a Memory API for storing/retrieving information outside the context window, and checkpoints for safe state restoration.
Skills System: Agents can discover and use Skills — markdown files and scripts stored on the filesystem. Agents see only short names and descriptions initially, loading full skill content on demand.
Hooks and Subagents: Full support for creating hierarchical agent structures with custom event handlers (hooks) that trigger on specific workflow events. Subagents can be spawned with strict, narrow roles.
The Claude Agent SDK follows a Unix-first design philosophy. Anthropic emphasizes that 'bash is all you need' for agents — low-level tools like grep, tail, and standard CLI utilities provide more effective agent capabilities than high-level abstractions.
Core architectural principles:
The multi-layered architecture includes:
from anthropic import Anthropic client = Anthropic() # Define tools for the agent tools = [ { "name": "read_file", "description": "Read contents of a file", "input_schema": { "type": "object", "properties": {"path": {"type": "string", "description": "File path"}}, "required": ["path"] } } ] # Agent loop with tool use messages = [{'role': 'user', 'content': 'Analyze the main.py file'}] while True: response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=4096, tools=tools, messages=messages ) if response.stop_reason == "tool_use": # Execute tool calls and continue tool_results = execute_tools(response.content) messages.append({'role': 'assistant', 'content': response.content}) messages.append({'role': 'user', 'content': tool_results}) else: print(response.content[0].text) break