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.
npx skills add basher83/lunar-claude --skill claude-agent-sdkgit clone --depth 1 https://github.com/basher83/lunar-claudeWrote 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.
[](https://agentmods.dev/skills/basher83/lunar-claude/claude-agent-sdk)<a href="https://agentmods.dev/skills/basher83/lunar-claude/claude-agent-sdk"><img src="https://agentmods.dev/badge/skills/basher83/lunar-claude/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.
<a href="https://agentmods.dev/skills/basher83/lunar-claude/claude-agent-sdk"><img src="https://agentmods.dev/badge/skills/basher83/lunar-claude/claude-agent-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00035 | $0.03793 |
| Opus 5 | $0.00017 | $0.01896 |
| Sonnet 5 | $0.00007 | $0.00759 |
| Haiku 4.5 | $0.00003 | $0.00379 |
Grade C, and why
claude-agent-sdk scanned grade C with 1 finding 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 11d ago.
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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
if tool_name == "Bash" and "rm -rf" in input_data.get("command", ""): How it starts
The opening of the file, as written. The whole thing — 564 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Claude Agent SDK
Build production-ready applications using the Claude Agent SDK for Python.
SDK Version: This skill targets claude-agent-sdk>=0.1.6 (Python)
Overview
This skill provides patterns, examples, and best practices for building SDK applications that orchestrate Claude agents.
Quick Start
Copy the template and customize:
cp assets/sdk-template.py my-app.py
# Edit my-app.py - customize agents and workflow
chmod +x my-app.py
./my-app.py
The template includes proper uv script headers, agent definitions, and async patterns.
Choosing Between query() and ClaudeSDKClient
The SDK provides two ways to interact with Claude: the query() function for simple one-shot tasks, and ClaudeSDKClient for continuous conversations.
Quick Comparison
| Feature | query() |
ClaudeSDKClient |
|---|---|---|
| Conversation memory | No - each call is independent | Yes - maintains context across queries |
| Use case | One-off tasks, single questions | Multi-turn conversations, complex workflows |
| Complexity | Simple - one function call | More setup - context manager pattern |
| Hooks support | No | Yes |
| Custom tools | No | Yes |
| Interrupts | No | Yes - can interrupt ongoing operations |
| Session control | New session each time | Single persistent session |
Important: Hooks and custom tools (SDK MCP servers) are only supported with
ClaudeSDKClient, not withquery(). If you need hooks or custom tools, you must useClaudeSDKClient.Note on Async Runtimes: The SDK works with both
asyncioandanyio. The official SDK examples preferanyio.run()for better async library compatibility, butasyncio.run()works equally well. Use whichever fits your project's async runtime.
When to Use query()
Use query() for simple, independent tasks where you don't need conversation history:
import anyio # or: import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions
async def analyze_file():
"""One-shot file analysis - no conversation needed."""
options = ClaudeAgentOptions(
system_prompt="You are a code analyzer",
allowed_tools=["Read", "Grep", "Glob"],
permission_mode="acceptEdits"
)
async for message in query(
prompt="Analyze /path/to/file.py for bugs",
options=options
):
print(message)
anyio.run(analyze_file) # or: asyncio.run(analyze_file())
What ships with it
23 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.
- assets/sdk-template.py 2.9 KB runs code
- assets/sdk-validation-checklist.md 11 KB
- examples/agents.py 4.3 KB runs code
- examples/basic-orchestrator.py 3.7 KB runs code
- examples/hooks.py 12 KB runs code
- examples/mcp_calculator.py 5.6 KB runs code
- examples/plugin_example.py 2.1 KB runs code
- examples/quick_start.py 2.0 KB runs code
- examples/setting_sources.py 5.5 KB runs code
- examples/streaming_mode.py 17 KB runs code
- examples/system_prompt.py 2.5 KB runs code
- examples/tool_permission_callback.py 5.2 KB runs code
- references/agent-patterns.md 5.5 KB
- references/api-reference.md 58 KB
- references/best-practices.md 9.0 KB
- references/custom-tools.md 21 KB
- references/hooks-guide.md 10 KB
- references/sessions.md 7.8 KB
- references/skills.md 10 KB
- references/slash-commands.md 12 KB
- references/subagents.md 11 KB
- references/system-prompts.md 6.3 KB
- references/tool-permissions.md 12 KB
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.
- 11d ago First seen · 564 lines · 35 tokens per session scan C 087d30045b8e
claude-agent-sdk is a skill published in the GitHub repository basher83/lunar-claude (23 stars, last pushed yesterday), licensed MIT. It adds 35 tokens to every session and 3,793 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…