소스 정보
- 저장소
- tomevault-io/skills-registry
- 최근 소스 활동
- 2026년 4월 28일 22:53
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill claude-agent-sdk-reference명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | claude-agent-sdk-reference |
| description | | Use when this capability is needed. |
Build production-ready AI agents using Anthropic's Claude Agent SDK.
from claude_agent_sdk import query, ClaudeAgentOptions
import asyncio
async def main():
options = ClaudeAgentOptions(
allowed_tools=["Read", "Write", "Bash"],
permission_mode="acceptEdits"
)
async for message in query(prompt="Create hello.py", options=options):
print(message)
asyncio.run(main())
All Claude agents follow this pattern:
For detailed patterns: See architecture-patterns.md
| Pattern | Use Case | State |
|---|---|---|
query() | One-shot tasks, serverless | Stateless |
ClaudeSDKClient | Multi-turn conversations | Stateful |
from claude_agent_sdk import query, ClaudeAgentOptions, ResultMessage
async for message in query(
prompt="Analyze this codebase",
options=ClaudeAgentOptions(
allowed_tools=["Read", "Grep"],
max_turns=5
)
):
if isinstance(message, ResultMessage):
print(f"Cost: ${message.total_cost_usd:.4f}")
from claude_agent_sdk import ClaudeSDKClient
async with ClaudeSDKClient() as client:
await client.query("What's in this repo?")
async for msg in client.receive_response():
print(msg)
# Follow-up with preserved context
await client.query("Show me the main entry point")
async for msg in client.receive_response():
print(msg)
For complete API reference: See python-sdk.md
| Aspect | Streaming | Single |
|---|---|---|
| Use Case | Interactive sessions | Serverless, one-shot |
| Feedback | Real-time | Final only |
| Interruption | Supported | Not available |
| Hooks | Full support | Not available |
For patterns and examples: See streaming.md
from claude_agent_sdk import tool, create_sdk_mcp_server, ClaudeAgentOptions
from typing import Any
@tool("greet", "Greet a user", {"name": str})
async def greet(args: dict[str, Any]) -> dict[str, Any]:
return {
"content": [{"type": "text", "text": f"Hello, {args['name']}!"}]
}
server = create_sdk_mcp_server(name="tools", tools=[greet])
options = ClaudeAgentOptions(
mcp_servers={"tools": server},
allowed_tools=["mcp__tools__greet"]
)
For tool design and MCP integration: See tools-mcp.md
Intercept tool execution for validation, logging, or blocking:
from claude_agent_sdk import ClaudeAgentOptions, HookMatcher, HookContext
from typing import Any
async def validate_bash(
input_data: dict[str, Any],
tool_use_id: str | None,
context: HookContext
) -> dict[str, Any]:
command = input_data.get("tool_input", {}).get("command", "")
if "rm -rf" in command:
return {
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "deny",
"permissionDecisionReason": "Dangerous command blocked"
}
}
return {}
options = ClaudeAgentOptions(
hooks={"PreToolUse": [HookMatcher(matcher="Bash", hooks=[validate_bash])]}
)
Hook events: PreToolUse, PostToolUse, UserPromptSubmit, Stop, SubagentStop, PreCompact
| Mode | Behavior |
|---|---|
default | Prompt for each action |
acceptEdits | Auto-approve file edits |
bypassPermissions | Fully autonomous |
Two authentication methods are supported:
| Method | Billing | Use Case |
|---|---|---|
| API Key | Per-token | Serverless, CI/CD, production |
| Subscription | Flat rate | Development, interactive sessions |
options = ClaudeAgentOptions(
env={"ANTHROPIC_API_KEY": "sk-ant-api..."},
)
First authenticate via CLI: claude setup-token
Then force OAuth by clearing any inherited API key:
options = ClaudeAgentOptions(
env={"ANTHROPIC_API_KEY": ""}, # Empty string forces OAuth
)
The SDK spawns a persistent Claude CLI subprocess that:
~/.claude/.credentials.json once at startupFor complete auth patterns and token lifecycle: See authentication.md
Key configuration fields:
ClaudeAgentOptions(
allowed_tools=["Read", "Write", "Bash"],
permission_mode="acceptEdits",
system_prompt="You are a coding assistant.",
max_turns=10,
max_budget_usd=5.0,
cwd="/path/to/project",
mcp_servers={"tools": server},
hooks={"PreToolUse": [...]},
setting_sources=["project"] # Load CLAUDE.md
)
| Tool | Purpose |
|---|---|
Read | Read file contents |
Write | Write file contents |
Edit | Edit existing files |
Bash | Execute shell commands |
Glob | Find files by pattern |
Grep | Search file contents |
WebSearch | Search the web |
WebFetch | Fetch URL content |
Task | Spawn subagents |
from claude_agent_sdk import (
AssistantMessage, # Claude's response
UserMessage, # User input
SystemMessage, # System events
ResultMessage, # Completion with cost
TextBlock, # Text content
ToolUseBlock, # Tool invocation
ToolResultBlock # Tool output
)
from claude_agent_sdk import (
ClaudeSDKError, # Base exception
CLINotFoundError, # SDK not installed
ProcessError, # Process failure
CLIJSONDecodeError # Parse error
)
max_turns and max_budget_usd limitspermission_mode="acceptEdits" for developmentFor deployment checklist: See architecture-patterns.md
Complete, runnable scripts demonstrating SDK patterns:
| Example | Purpose | Key Patterns |
|---|---|---|
| basic_query.py | Simplest working agent | query(), message handling, error handling |
| custom_tools.py | Custom MCP tools | @tool decorator, create_sdk_mcp_server |
| stateful_client.py | Production patterns | ClaudeSDKClient, hooks, multi-turn |
| extended_thinking.py | Extended thinking | ThinkingBlock, max_thinking_tokens |
| streaming_events.py | Real-time streaming | StreamEvent, include_partial_messages |
All examples require claude-agent-sdk>=0.1.20 and the Claude Code CLI.
mcp__context7__get-library-docs with /anthropics/claude-agent-sdk-pythonrag_search_knowledge_base(query="Claude Agent SDK")Use for:
Not for:
Converted and distributed by TomeVault — claim your Tome and manage your conversions.