building-with-claude-agent-sdk
Use when building AI agents with Anthropic's Claude Agent SDK (formerly Claude Code SDK). Triggers include creating autonomous agents, building agentic applications, SDK-based automation, implementing hooks/subagents/MCP servers, session management, or agent tool usage. NOT when using Claude API directly (use anthropic-sdk) or building MCP servers from scratch (use mcp-builder).
npx skills add majiayu000/claude-skill-registry --skill building-with-claude-agent-sdk --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Claude Agent SDK Development Guide Build production AI agents that autonomously read files, run commands, search the web, edit code, and more. ## Overview The Claude Agent SDK gives you the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript. It differs from the Anthropic Client SDK: with the Client SDK you implement the tool loop yourself; with the Agent SDK, Claude handles tool execution autonomously. ## Quick Reference ### Installation ```bash # Step 1: Install Claude Code (required runtime) curl -fsSL https://claude.ai/install.sh | bash # macOS/Linux/WSL # or: npm install -g @anthropic-ai/claude-code # Step 2: Install SDK pip install claude-agent-sdk # Python npm install @anthropic-ai/claude-agent-sdk # TypeScript ``` ### Authentication ```bash export ANTHROPIC_API_KEY=your-api-key # Alternative providers: # export CLAUDE_CODE_USE_BEDROCK=1 (Amazon Bedrock) # export CLAUDE_CODE_USE_VERTEX=1 (Google Vertex AI) ``` ### Basic Usage ```python # Python import asyncio from claude_agent_sdk import query, ClaudeAgentOptions async def main(): async for message in query( prompt="Find and fix the bug in auth.py", options=ClaudeAge
- Overview
- Quick Reference
- Installation
- Authentication
- Basic Usage
- Built-in Tools
- Permission Modes
- Key Configuration Options
- Unique Features (Not in OpenAI/Google SDKs)
- Agent Skills via settingSources
- Custom Slash Commands
- File Checkpointing
- Runtime Permissions with canUseTool
- Cost Tracking
Step 1: Install Claude Code (required runtime) curl -fsSL https://claude.ai/install.sh | bash # macOS/Linux/WSL Step 2: Install SDK pip install claude-agent-sdk # Python npm install @anthropic-ai/claude-agent-sdk # TypeScript export ANTHROPIC_API_KEY=your-api-key Alternative providers: export CLAUDE_CODE_USE_BEDROCK=1 (Amazon Bedrock) export CLAUDE_CODE_USE_VERTEX=1 (Google Vertex AI)
What does the building-with-claude-agent-sdk skill do?
Use when building AI agents with Anthropic's Claude Agent SDK (formerly Claude Code SDK). Triggers include creating autonomous agents, building agentic applications, SDK-based automation, implementing hooks/subagents/MCP servers, session management, or agent tool usage. NOT when using Claude API directly (use anthropic-sdk) or building MCP servers from scratch (use mcp-builder).
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill building-with-claude-agent-sdk --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
