claude-agent-sdk

claude-agent-sdk is a skill for Claude Code from berekvolgyipeter/dotclaude. It costs 107 tokens per session (2,572 once invoked), scanned A, original, MIT.

A skill for building applications with the Claude Agent SDK in Python. The SDK is a programming library for creating agents that can use tools, keep sessions, and interact with users.

In plain words
What is it for?
Creating Python agents, adding custom tools and subagents, managing sessions and permissions, connecting MCP servers, and deploying SDK-based applications.
Why use it?
Agent applications involve choices about sessions, permissions, streaming responses, hooks, and errors that are easy to get wrong. The skill provides implementation and troubleshooting guidance for those areas.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents.

Good fit Creating Python agents, adding custom tools and subagents, managing sessions and permissions, connecting MCP servers, and deploying SDK-based applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/berekvolgyipeter/dotclaude/claude-agent-sdk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add berekvolgyipeter/dotclaude --skill claude-agent-sdk
Clone the repo
git clone --depth 1 https://github.com/berekvolgyipeter/dotclaude

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for claude-agent-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/berekvolgyipeter/dotclaude/claude-agent-sdk/github.svg)](https://agentmods.dev/skills/berekvolgyipeter/dotclaude/claude-agent-sdk)
Your own site
<a href="https://agentmods.dev/skills/berekvolgyipeter/dotclaude/claude-agent-sdk"><img src="https://agentmods.dev/badge/skills/berekvolgyipeter/dotclaude/claude-agent-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for claude-agent-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/berekvolgyipeter/dotclaude/claude-agent-sdk"><img src="https://agentmods.dev/badge/skills/berekvolgyipeter/dotclaude/claude-agent-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,572 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.02572
Opus 5 $0.00053 $0.01286
Sonnet 5 $0.00021 $0.00514
Haiku 4.5 $0.00011 $0.00257

Measured 8d ago against content hash d3476875c4bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

claude-agent-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/clone-python-sdk-repo.sh, scripts/fetch-agent-sdk-urls.sh, scripts/index-references.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/claude-agent-sdk/SKILL.md · 218 lines

How it starts

The opening of the file, as written. The whole thing — 218 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Agent SDK

When to Use This Skill

Use this skill when:

  • You're building with the Agent SDK in Python (one-off queries, persistent agents, multi-turn conversations)
  • You need to decide between API patterns (e.g., query() vs ClaudeSDKClient, streaming vs buffered)
  • You're implementing features like custom tools, session management, permissions, or hooks
  • You're architecting agent applications (error handling, permissions, cost control, session branching)
  • You want working code examples from real SDK code
  • You need to troubleshoot Agent SDK issues or understand API behavior

How to Answer SDK Questions

The SDK evolves frequently. The patterns below capture stable concepts, but field names and exact APIs may have moved. Verify concrete API details against the live source before quoting them:

  1. Refresh the doc index when fetching docs. If you need to consult the official docs to answer (i.e. you'll hit step 1 below), run bash ~/.claude/skills/claude-agent-sdk/scripts/fetch-agent-sdk-urls.sh first to rewrite references/agent-sdk-urls.md from Anthropic's current llms.txt. Skip the refresh for purely conceptual answers or when the existing snapshot is sufficient.
  2. Check official docs for conceptual explanations: fetch from the URLs listed in agent-sdk-urls.md.
  3. Search the indexed repo for the feature in question:
    mcp__claude-context__search_code(
      path="~/.claude/skills-references/claude-agent-sdk/claude-agent-sdk-python",
      query="<feature name or concept>"
    )
    
  4. Browse examples for working usage patterns:
    Glob(~/.claude/skills-references/claude-agent-sdk/claude-agent-sdk-python/examples/*.py)
    
  5. Read specific example files when you find a relevant match — these are the source of truth.

Core Concepts

These concepts are architecturally stable — the names and roles don't change, even if exact field names evolve.

Read the full file on GitHub · 218 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 218 lines · 107 tokens per session scan A d3476875c4bd

Subscribe to this mod's changes

claude-agent-sdk is a skill published in the GitHub repository berekvolgyipeter/dotclaude (2 stars, last pushed 2d ago), licensed MIT. It adds 107 tokens to every session and 2,572 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.