Claude Agents SDK
Learn to Build AI Agents
Master the Claude Agents SDK with our comprehensive guide. Learn to build AI agents that can read files, write code, run commands, and complete complex tasks autonomously.
What is the Agents SDK?
Understand what the Claude Agents SDK is and see it in action with an interactive code example.
Quickstart
Set up your environment and build your first AI agent in minutes.
The Agent SDK
Deep dive into the core functions: query(), tool(), and createSdkMcpServer().
Types
TypeScript type definitions including Options, McpServerConfig, and more.
Capabilities
Explore built-in tools, hooks, subagents, MCP, permissions, and sessions.
Claude Code Features
Learn about skills, slash commands, memory, and plugins.
Get Started
Step-by-step setup guide and comparison with other Claude tools.
Tools
Tool Outputs & Permissions
Other Types
Streaming Input
Configure Permissions
Control how your agent uses tools with permission modes, hooks, and allow/deny rules.
Handle Approvals & User Input
Surface Claude's approval requests and clarifying questions to users.
Control Execution with Hooks
Intercept and control tool execution with pre and post tool use hooks.
Structured Outputs
Get typed, validated responses using JSON schemas and Zod.
Session Management
Continue conversations across interactions with session resumption and forking.
File Checkpointing
Track file changes during agent sessions and restore files to any previous state.
Ready to start building?
Jump straight into the quickstart guide and build your first agent.
Start Building