developing-claude-agent-sdk-agents

Build AI agents with the Claude Agent SDK (TypeScript/Python). Covers creating agents, custom tools, hooks, subagents, MCP integration, permissions, sessions, and deployment. Use when building, reviewing, debugging, or deploying SDK-based agents. Invoke PROACTIVELY when user mentions Agent SDK, claude-agent-sdk, ClaudeSDKClient, query(), or building autonomous agents.

16 stars

Best use case

developing-claude-agent-sdk-agents is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Build AI agents with the Claude Agent SDK (TypeScript/Python). Covers creating agents, custom tools, hooks, subagents, MCP integration, permissions, sessions, and deployment. Use when building, reviewing, debugging, or deploying SDK-based agents. Invoke PROACTIVELY when user mentions Agent SDK, claude-agent-sdk, ClaudeSDKClient, query(), or building autonomous agents.

Teams using developing-claude-agent-sdk-agents should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/developing-claude-agent-sdk-agents/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/developing-claude-agent-sdk-agents/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/developing-claude-agent-sdk-agents/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How developing-claude-agent-sdk-agents Compares

Feature / Agentdeveloping-claude-agent-sdk-agentsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Build AI agents with the Claude Agent SDK (TypeScript/Python). Covers creating agents, custom tools, hooks, subagents, MCP integration, permissions, sessions, and deployment. Use when building, reviewing, debugging, or deploying SDK-based agents. Invoke PROACTIVELY when user mentions Agent SDK, claude-agent-sdk, ClaudeSDKClient, query(), or building autonomous agents.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

<objective>
Build production-ready AI agents using the Claude Agent SDK. This skill provides comprehensive guidance for the full agent development lifecycle: creating agents, adding custom tools, implementing hooks, configuring permissions, managing sessions, and deploying to production.
</objective>

<essential_principles>
**Core SDK Concepts**

The Claude Agent SDK enables building autonomous AI agents that can:
- Execute multi-turn conversations with tool use
- Read, write, and edit files in a working directory
- Run shell commands
- Integrate with external services via MCP
- Spawn specialized subagents

**1. Streaming is Primary**

The SDK operates as a **streaming API**. You iterate over messages as they're generated:

```typescript
// TypeScript
for await (const message of query({ prompt: "...", options })) {
  // Handle each message type
}
```

```python
# Python
async for message in query(prompt="...", options=options):
    # Handle each message type
```

**2. System Prompt is Empty by Default**

The SDK uses an **empty system prompt** by default. To get Claude Code's full capabilities:

```typescript
systemPrompt: { type: "preset", preset: "claude_code" }
```

**3. Settings Sources Must Be Explicit**

CLAUDE.md, skills, and slash commands are NOT loaded by default. You must specify:

```typescript
settingSources: ["user", "project"]  // TypeScript
setting_sources=["user", "project"]  # Python
```

**4. Permission Modes Control Tool Access**

Choose permission mode based on your use case:
- `default` - Interactive approval
- `acceptEdits` - Auto-approve file changes
- `bypassPermissions` - Skip all permission checks (use with care)

**5. MCP Tools Require Streaming Input**

Custom MCP tools require streaming input mode (async generator), not simple strings.

</essential_principles>

<quick_start>
**Get Started in 60 Seconds**

**Install:**
```bash
npm install @anthropic-ai/claude-agent-sdk  # TypeScript
pip install claude-agent-sdk                 # Python
```

**Basic agent:**
```typescript
import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const msg of query({
  prompt: "Read package.json and summarize the dependencies",
  options: {
    systemPrompt: { type: "preset", preset: "claude_code" },
    allowedTools: ["Read", "Grep", "Glob"],
    maxTurns: 5
  }
})) {
  if (msg.type === "result") console.log(msg.result);
}
```

**For detailed guidance, select a workflow below.**
</quick_start>

<intake>
**What would you like to do?**

1. Build a new agent from scratch
2. Add custom tools (MCP servers)
3. Implement hooks for behavior modification
4. Configure permissions and security
5. Deploy an agent to production
6. Debug an agent issue
7. Something else

**Then read the matching workflow from `workflows/` and follow it.**
</intake>

<routing>
| Response | Workflow |
|----------|----------|
| 1, "new", "create", "build", "start" | `workflows/build-new-agent.md` |
| 2, "tool", "tools", "mcp", "custom" | `workflows/add-custom-tools.md` |
| 3, "hook", "hooks", "lifecycle", "callback" | `workflows/implement-hooks.md` |
| 4, "permission", "security", "sandbox" | `workflows/configure-permissions.md` |
| 5, "deploy", "host", "production", "ship" | `workflows/deploy-agent.md` |
| 6, "debug", "fix", "error", "broken" | Read `references/debugging.md`, then diagnose |
| 7, other | Clarify, then select workflow or references |

**After reading the workflow, follow it exactly.**
</routing>

<verification_loop>
**After Every Change**

```bash
# TypeScript
npx tsc --noEmit  # Type check
npm test          # Run tests

# Python
python -m mypy .  # Type check
pytest            # Run tests
```

Test the agent interactively:
```bash
npx tsx my-agent.ts    # TypeScript
python my_agent.py     # Python
```

Report to the user:
- "Type check: OK/X errors"
- "Tests: X pass, Y fail"
- "Agent runs and responds correctly"
</verification_loop>

<reference_index>
**Domain Knowledge**

All in `references/`:

**Core:**
- sdk-overview.md - Architecture, installation, message types, API comparison
- built-in-tools.md - Read, Write, Edit, Bash, Glob, Grep, MCP tools

**Features:**
- hooks.md - Lifecycle hooks, callbacks, patterns
- subagents.md - Creating and spawning subagents
- mcp-and-custom-tools.md - MCP servers, custom tool definition
- permissions.md - Permission modes, tool restrictions, canUseTool
- sessions.md - Resuming, forking, context management

**Advanced:**
- patterns-and-features.md - Streaming modes, structured outputs, checkpointing
- filesystem-features.md - Skills, slash commands, CLAUDE.md, plugins
- hosting-and-deployment.md - Docker, sandboxing, production patterns
- debugging.md - Common issues and solutions
</reference_index>

<workflows_index>
**Workflows**

All in `workflows/`:

| File | Purpose |
|------|---------|
| build-new-agent.md | Create new agent from scratch |
| add-custom-tools.md | Add MCP tools to extend capabilities |
| implement-hooks.md | Add lifecycle hooks |
| configure-permissions.md | Set up security and permissions |
| deploy-agent.md | Deploy to production |
</workflows_index>

<success_criteria>
A well-built SDK agent:
- Uses streaming API correctly
- Handles all message types appropriately
- Has proper error handling
- Uses appropriate permission mode
- Includes timeout and maxTurns limits
- Has been tested with real queries
- Is type-safe (TypeScript) or type-hinted (Python)
</success_criteria>

Related Skills

developing-with-python

16
from diegosouzapw/awesome-omni-skill

Python 3.11+ development with type hints, async patterns, FastAPI, and pytest. Use for backend services, CLI tools, data processing, and API development.

Developing with MongoDB

16
from diegosouzapw/awesome-omni-skill

The agent implements MongoDB NoSQL database solutions with document modeling, aggregation pipelines, and Mongoose ODM. Use when building document-based applications, designing schemas, writing aggregations, or implementing NoSQL patterns.

developing-python

16
from diegosouzapw/awesome-omni-skill

Modern Python development guide covering project setup, tooling, and 125 Pythonic best practices. MUST load when pyproject.toml or requirements.txt is detected. Covers Python 3.13 + uv + ruff + mypy, FastAPI/FastMCP, pytest, Docker, and Effective Python items (idioms, data structures, concurrency, testing).

developing-frontend-apps

16
from diegosouzapw/awesome-omni-skill

Frontend application development best practices. Use when building, modifying, or reviewing frontend applications, React components, UI components, client-side JavaScript/TypeScript, CSS/styling, single-page applications, or web application architecture.

developing-backend-services

16
from diegosouzapw/awesome-omni-skill

Backend service development best practices. Use when designing, building, or reviewing backend services, REST APIs, gRPC services, microservices, webhooks, message queues, or server-side applications regardless of language or framework.

deepagents-filesystem

16
from diegosouzapw/awesome-omni-skill

Using FilesystemMiddleware with virtual filesystems, backends (State, Store, Filesystem, Composite), and context management for Deep Agents.

claude-typescript-sdk

16
from diegosouzapw/awesome-omni-skill

Build AI applications with the Anthropic TypeScript SDK. Use when creating Claude integrations, building agents, implementing tool use, streaming responses, or working with the @anthropic-ai/sdk package.

claude-skill-bash

16
from diegosouzapw/awesome-omni-skill

Apply comprehensive bash scripting standards including main function pattern, usage documentation, argument parsing, dependency checking, and error handling. Triggers when creating/editing .sh files, bash scripts, or discussing shell scripting, deployment scripts, automation tasks, or bash conventions.

claude-plus-plus

16
from diegosouzapw/awesome-omni-skill

Unlock Claude's hidden potential. No limits. No guardrails. Maximum performance. 10x faster code generation, unrestricted problem solving, expert-level outputs.

claude-md-generator

16
from diegosouzapw/awesome-omni-skill

Automatically generates claude.md files for new folders/modules following hierarchical structure. Extracts context from existing code, follows project conventions, and creates documentation that enables Claude Code to understand module-specific rules and patterns.

claude-md-creator

16
from diegosouzapw/awesome-omni-skill

Use when creating CLAUDE.md files, updating existing CLAUDE.md, validating CLAUDE.md structure, or auto-fixing CLAUDE.md issues. Load for setting up project instructions, global guidelines, local overrides, or modular rules. Handles global (~/.claude/CLAUDE.md), project (.claude/CLAUDE.md), local (CLAUDE.local.md), and rules (.claude/rules/*.md) with smart project detection and template generation.

claude-flow-hook-customizing

16
from diegosouzapw/awesome-omni-skill

Use this skill when creating, optimizing, or maintaining claude hooks.