Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Claude Agent Sdk

ASecurity

Claude Agent SDK (TS @anthropic-ai/claude-agent-sdk, Python claude_agent_sdk), wrapping Claude Code. Use for query()/ClaudeSDKClient, SDK hooks, subagents (AgentDefinition), SDK MCP servers, permissionMode/permission_mode, structured outputs, Docker/K8s sandbox, sessions (resume, fork, SessionStore to S3/Redis/Postgres), SDK errors. Skip: Claude Code CLI config (use claude-code), Messages API (use anthropic-api), MCP spec (use mcp-spec), hosted Managed Agents (use anthropic-platform-features).

17 stars
0 votes
0 copies
0 views
Added 9/30/2026
ai-agentstypescriptpythonnodedockerkubernetesgitapi

Works with

claude codecliapimcp

Security Analysis

A100/100

Pro scans all 19 files and shows the line behind each finding

Scanned 9/30/2026

$npx -y skills add xiaolai/anthropic-docs --skill claude-agent-sdk --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Claude Agent Sdk?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Claude Agent Sdk
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/xiaolai-claude-agent-sdk/badge)](https://www.skillsdirectory.com/skills/xiaolai-claude-agent-sdk)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: claude-agent-sdk
description: |
  Claude Agent SDK (TS @anthropic-ai/claude-agent-sdk, Python
  claude_agent_sdk), wrapping Claude Code. Use for
  query()/ClaudeSDKClient, SDK hooks, subagents (AgentDefinition), SDK MCP
  servers, permissionMode/permission_mode, structured outputs, Docker/K8s
  sandbox, sessions (resume, fork, SessionStore to S3/Redis/Postgres), SDK
  errors. Skip: Claude Code CLI config (use claude-code), Messages API
  (use anthropic-api), MCP spec (use mcp-spec), hosted Managed Agents (use
  anthropic-platform-features).
user-invocable: true
---

# Claude Agent SDK Reference

| | TypeScript | Python |
|---|---|---|
| **Version** | v0.3.159 | v0.2.87 |
| **Package** | `@anthropic-ai/claude-agent-sdk` | `claude-agent-sdk` (PyPI) |
| **Docs** | [TypeScript SDK](https://platform.claude.com/docs/en/agent-sdk/typescript) | [Python SDK](https://platform.claude.com/docs/en/agent-sdk/python) |
| **Repo** | [claude-agent-sdk-typescript](https://github.com/anthropics/claude-agent-sdk-typescript) | [claude-agent-sdk-python](https://github.com/anthropics/claude-agent-sdk-python) |
| **Full reference** | [SKILL-typescript.md](SKILL-typescript.md) | [SKILL-python.md](SKILL-python.md) |

## When to use

Router skill for the Claude Agent SDK — Anthropic's libraries for
building autonomous AI agents that wrap the Claude Code CLI runtime.
Ships in TypeScript (`@anthropic-ai/claude-agent-sdk` on npm) and
Python (`claude-agent-sdk` on PyPI). Covers `query()` / `ClaudeSDKClient`,
hooks (PreToolUse / PostToolUse / Stop / etc.), subagents, MCP
servers (stdio / HTTP / SSE / SDK in-process), permission modes,
the sandbox (Docker / Kubernetes), structured outputs (JSON Schema
validation), session capture / resume / fork, and session storage
adapters (`SessionStore`, `InMemorySessionStore`, S3/Redis/Postgres).

Use when the user asks about: importing `@anthropic-ai/claude-agent-sdk`
in TypeScript or `from claude_agent_sdk import ...` in Python, writing
an agent that uses `query()` or `ClaudeSDKClient`, registering hooks
via the SDK (`hooks: { PreToolUse: [...] }` / `hooks={"PreToolUse": [...]}`),
defining MCP servers in SDK options, configuring `permissionMode` /
`permission_mode`, building subagents with `AgentDefinition`, enabling
structured outputs, running agents in a Docker/K8s sandbox, capturing
and resuming sessions, mirroring session transcripts to external storage
(S3, Redis, Postgres) via `SessionStore`, or troubleshooting SDK-specific
errors (the
SDK wraps Claude Code, so its errors differ from raw Messages API
errors).

Skip: questions about the Claude Code CLI itself such as `.claude/
settings.json` or `.mcp.json` files (use claude-code), the Anthropic
Messages API directly without the SDK (use anthropic-api), the MCP
protocol spec itself (use mcp-spec), or Anthropic's hosted Managed
Agents product (use anthropic-platform-features).

## When you detect the user's language

- Working with `.ts` files, TypeScript imports, or `npm`/`node` → read `SKILL-typescript.md`
- Working with `.py` files, Python imports, or `pip`/`python` → read `SKILL-python.md`
- Ambiguous or multi-language → read both surface files

## Cross-Language Naming Map

| Concept | TypeScript | Python |
|---------|-----------|--------|
| One-shot query | `query(options)` | `query(options)` |
| Stateful client | N/A (query manages state) | `ClaudeSDKClient` |
| Options type | `Options` interface | `ClaudeAgentOptions` dataclass |
| Tool definition | `tool(name, schema, handler)` | `@tool(name, desc, schema)` decorator |
| MCP server factory | `createSdkMcpServer()` | `create_sdk_mcp_server()` |
| Permission callback | `canUseTool` | `can_use_tool` |
| Permission mode | `permissionMode: "..."` | `permission_mode="..."` |
| Hook registration | `hooks: { PreToolUse: [...] }` | `hooks={"PreToolUse": [...]}` |
| System prompt | `systemPrompt` | `system_prompt` |
| Max turns | `maxTurns` | `max_turns` |
| Allowed tools | `allowedTools` | `allowed_tools` |
| MCP servers | `mcpServers` | `mcp_servers` |
| Subagent def | `AgentDefinition` | `AgentDefinition` dataclass |

## Shared Concepts (both languages)

Both SDKs wrap the Claude Code CLI and share these concepts:
- **Hooks**: Pre/PostToolUse, Stop, SubagentStop, Notification, etc.
- **Permissions**: default, acceptEdits, plan, bypassPermissions, etc.
- **MCP Servers**: stdio, HTTP, SSE, SDK (in-process) configurations
- **Subagents**: Delegate tasks to child agents with scoped tools/permissions
- **Structured Outputs**: JSON Schema validation on agent output
- **Sandbox**: Container-based isolation (Docker/Kubernetes)
- **Sessions**: Capture, resume, fork, and mirror transcripts to external storage (`SessionStore`)

For API details, code examples, options tables, and known issues,
read the language-specific reference file.

## Examples

<example>
Context: A developer is building an agent in TypeScript.
user: "How do I resume a session with query() and store transcripts in Postgres?"
assistant: Uses claude-agent-sdk and reads the TypeScript reference for session resume and SessionStore.
</example>

<example>
Context: A developer asks about CLI settings.
user: "Where does Claude Code read settings.local.json from?"
assistant: Routes to claude-code instead; that is CLI configuration, not the SDK.
</example>

Attribution

xiaolaixiaolai
View sourceSee grades on GitHubMore from xiaolai →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →