claude-agent-sdk-ts
Skill1 starsChanged 10 months agoMITView on GitHub
TypeScript reference for @anthropic-ai/claude-agent-sdk — build AI agents with Claude Code. Keywords: claude sdk, agent sdk, claude code sdk, typescript agent, mcp server, subagent, multi-agent, claude api, anthropic sdk
- Reads credentials
- Deletes or force-pushes
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- olaservo/mcp-agent-skillstheir own version, first seen Jan 31, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- olaservo/mcp-agent-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 492
Read historical messages from a session transcript.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude Agent SDK — TypeScript Reference
Package:
@anthropic-ai/claude-agent-sdk@0.2.81Runtime: Node.js 18+ / Bun 1.0+ Last verified: 2026-03-21
Quick Start
# Install
npm install @anthropic-ai/claude-agent-sdk
# or
bun add @anthropic-ai/claude-agent-sdkimport { query } from "@anthropic-ai/claude-agent-sdk";
const q = query({
prompt: "Write a hello world function in TypeScript",
options: {
maxTurns: 3,
},
});
for await (const message of q) {
if (message.type === "assistant") {
process.stdout.write(message.content);
}
}Core API
query(options) — V1 Stable API
Creates an async generator that yields SDKMessage events.
import { query, type QueryOptions, type SDKMessage } from "@anthropic-ai/claude-agent-sdk";
const q: Query = query({
prompt: "Your prompt here",
options: { /* QueryOptions */ },
});
for await (const message of q) {
// Handle messages
}
const result = await q.result; // Final result after iterationQuery Methods
| Method | Description |
q.supportedAgents() | Promise<AgentInfo[]> — list available subagents (v0.2.63+) |
q.result | Promise<QueryResult> — final result after generator completes |
q.interrupt() | Interrupt current generation |
q.rewindFiles() | Revert file changes to pre-query state |
q.setPermissionMode(mode) | Change permission mode mid-query |
q.setModel(model) | Change model mid-query |
q.close() | Close the query and free resources (added v0.2.15) |
QueryResult
interface QueryResult {
sessionId: string;
totalCost: number; // USD
totalInput: number; // Input tokens
totalOutput: number; // Output tokens
duration: number; // Milliseconds
numTurns: number;
stop_reason: string; // "end_turn" | "max_turns" | "interrupt" (added v0.2.31)
}V2 Preview API
Simplified multi-turn session management. All functions are unstable_ prefixed.
import {
unstable_v2_prompt,
unstable_v2_createSession,
unstable_v2_resumeSession,
} from "@anthropic-ai/claude-agent-sdk";Single-turn (V2)
const result = await unstable_v2_prompt({
prompt: "Explain async generators",
options: { maxTurns: 1 },
});
// result: QueryResultMulti-turn Session (V2)
// Create a new session
await using session = unstable_v2_createSession({ options });
// Send a message and stream responses
const stream = session.stream("Build a REST API");
for await (const message of stream) {
// Handle messages
}
// Send follow-up
const stream2 = session.stream("Add authentication");
for await (const message of stream2) {
// Handle messages
}
// Resume an existing session
await using resumed = unstable_v2_resumeSession(sessionId, { options });Note: V2 uses
stream()(renamed fromreceive()in v0.2.72+). Sessions implementAsyncDisposable— useawait usingfor automatic cleanup.
Options Reference
QueryOptions
| Option | Type | Default | Description |
prompt | string | required | The user prompt |
options.model | string | "sonnet" | Model alias ("sonnet", "opus", "haiku") or full model ID ("claude-opus-4-5") |
options.systemPrompt | string | undefined | System prompt prepended to conversation |
options.appendSystemPrompt | string | undefined | Appended after default system prompt |
options.maxTurns | number | Infinity | Max agentic turns (API round-trips) |
options.permissionMode | PermissionMode | "default" | "default" | "acceptEdits" | "bypassPermissions" | "plan" |
options.canUseTool | (tool, input) => Decision | undefined | Per-tool permission callback |
options.tools | Tool[] | [] | Custom tools via tool() helper |
options.mcpServers | MCPServerConfig[] | [] | MCP server connections |
options.subagents | AgentDefinition[] | [] | Subagent definitions |
options.allowedTools | string[] | undefined | Whitelist of tool names |
options.disallowedTools | string[] | undefined | Blacklist of tool names |
options.cwd | string | process.cwd() | Working directory |
options.sessionId | string | auto-generated | Custom session ID (added v0.2.33) |
options.resume | { sessionId, transcript } | undefined | Resume a previous session |
options.contextWindow | number | model default | Context window size in tokens |
options.maxCachePoints | number | undefined | Max prompt caching breakpoints |
options.debug | boolean | false | Enable debug logging (added v0.2.30) |
options.debugFile | string | undefined | Write debug logs to file (added v0.2.30) |
options.enableFileCheckpointing | boolean | false | Enable file state checkpointing |
options.outputFormat | OutputFormat | undefined | Structured output format |
options.sandbox | SandboxSettings | undefined | Sandbox configuration |
options.additionalDirectories | string[] | [] | Extra dirs for CLAUDE.md loading (added v0.2.19) |
options.betaFeatures | string[] | [] | Beta feature flags |
options.thinking | ThinkingConfig | undefined | Thinking/reasoning behavior: { type: 'adaptive' }, { type: 'enabled', budgetTokens?: number }, or { type: 'disabled' } (v0.2.50+) |
options.promptSuggestions | boolean | undefined | Enable prompt suggestions after each turn (v0.2.50+) |
options.hooks | HookConfig | undefined | Event hook configuration |
options.onElicitation | OnElicitation | undefined | Callback for MCP elicitation requests — called when an MCP server requests user input and no hook handles it (v0.2.63+) |
options.toolConfig | ToolConfig | undefined | Per-tool configuration for built-in tools, e.g. { askUserQuestion: { previewFormat: 'html' } } (v0.2.70+) |
options.settings | string | Settings | undefined | Additional settings (path to JSON or object) — loaded as highest-priority "flag settings" layer (v0.2.70+) |
options.agentProgressSummaries | boolean | false | Enable periodic AI-generated progress summaries for running subagents — emits summary field on task_progress events (v0.2.76+) |
options.initialUserMessage | string | undefined | Initial user message to prefill the conversation context (v0.2.81+) |
Permission Modes
| Mode | Behavior |
"default" | Prompts for dangerous tools, auto-allows safe reads |
"acceptEdits" | Auto-allows file edits, prompts for Bash |
"bypassPermissions" | Auto-allows everything — use only in sandboxed environments |
"plan" | Read-only exploration, no writes allowed |
canUseTool Callback
import { query, type ToolUseDecision } from "@anthropic-ai/claude-agent-sdk";
const q = query({
prompt: "Refactor the auth module",
options: {
canUseTool(toolName: string, toolInput: Record<string, unknown>): ToolUseDecision {
// Allow all read operations
if (toolName === "Read" || toolName === "Glob" || toolName === "Grep") {
return { allowed: true };
}
// Block dangerous commands
if (toolName === "Bash" && String(toolInput.command).includes("rm -rf")) {
return { allowed: false, reason: "Destructive commands not allowed" };
}
// Defer to permission mode for everything else
return undefined;
},
},
});Return values:
{ allowed: true }— Allow the tool use{ allowed: false, reason: string }— Deny with reasonundefined— Defer to permission mode
Tool Integration
Custom Tools with tool()
import { query, tool } from "@anthropic-ai/claude-agent-sdk";
import { z } from "zod";
const weatherTool = tool({
name: "get_weather",
description: "Get current weather for a location",
inputSchema: z.object({
city: z.string().describe("City name"),
units: z.enum(["celsius", "fahrenheit"]).default("celsius"),
}),
async execute(input) {
const data = await fetchWeather(input.city, input.units);
return { content: JSON.stringify(data) };
},
// Tool annotations (added v0.2.27)
annotations: {
readOnlyHint: true,
destructiveHint: false,
openWorldHint: true,
idempotentHint: true,
},
});
const q = query({
prompt: "What's the weather in Tokyo?",
options: {
tools: [weatherTool],
maxTurns: 5,
},
});MCP Servers
Four transport types supported:
const q = query({
prompt: "List my issues",
options: {
mcpServers: [
// 1. stdio — spawns a subprocess
{
type: "stdio",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-github"],
env: { GITHUB_TOKEN: process.env.GITHUB_TOKEN! },
},
// 2. sse — Server-Sent Events (legacy)
{
type: "sse",
url: "http://localhost:3001/sse",
headers: { Authorization: `Bearer ${token}` },
},
// 3. http — Streamable HTTP (recommended for remote)
{
type: "http",
url: "https://mcp.example.com/mcp",
headers: { Authorization: `Bearer ${token}` },
},
// 4. sdk — In-process MCP server (zero network overhead)
{
type: "sdk",
server: myMcpServer, // McpServer instance
serverName: "my-tools",
},
],
},
});In-Process MCP Server with createSdkMcpServer()
import { query, createSdkMcpServer } from "@anthropic-ai/claude-agent-sdk";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
const mcpServer = new McpServer({ name: "my-tools", version: "1.0.0" });
mcpServer.tool("calculate", { expression: z.string() }, async ({ expression }) => ({
content: [{ type: "text", text: String(eval(expression)) }],
}));
const q = query({
prompt: "What is 42 * 37?",
options: {
mcpServers: [{ type: "sdk", server: mcpServer, serverName: "my-tools" }],
},
});MCP Server Management (v0.2.21+)
// Reconnect a server
await q.reconnectMcpServer("my-tools");
// Toggle server on/off
await q.toggleMcpServer("my-tools", false); // disable
await q.toggleMcpServer("my-tools", true); // enableSubagents
Define subagents that Claude can spawn to handle specialized tasks.
import { query, tool, type AgentDefinition } from "@anthropic-ai/claude-agent-sdk";
const agents: AgentDefinition[] = [
{
name: "researcher",
description: "Searches the web and gathers information on a topic",
model: "haiku",
permissionMode: "bypassPermissions",
tools: [searchTool],
mcpServers: [{ type: "stdio", command: "npx", args: ["web-search-server"] }],
systemPrompt: "You are a research assistant. Be thorough and cite sources.",
maxTurns: 10,
},
{
name: "coder",
description: "Writes and tests TypeScript code",
model: "sonnet",
permissionMode: "acceptEdits",
systemPrompt: "Write clean, tested TypeScript code.",
maxTurns: 20,
},
];
const q = query({
prompt: "Research React Server Components and implement a demo",
options: {
subagents: agents,
maxTurns: 30,
},
});AgentInfo Type (v0.2.63+)
Returned by q.supportedAgents() — describes available subagents for the current session.
interface AgentInfo {
name: string; // Agent type identifier (e.g., "Explore")
description: string; // When to use this agent
model?: string; // Model alias (inherits parent if omitted)
}AgentDefinition Type
interface AgentDefinition {
name: string; // Agent name (used as tool name)
description: string; // What the agent does
model?: string; // Model alias or full model ID (v0.2.76+: widened from union to string)
permissionMode?: PermissionMode; // Permission mode for the agent
tools?: Tool[]; // Custom tools
mcpServers?: MCPServerConfig[]; // MCP servers
systemPrompt?: string; // System prompt
maxTurns?: number; // Max turns
allowedTools?: string[]; // Tool whitelist
disallowedTools?: string[]; // Tool blacklist
}Session Management
V1 — Resume and Fork
// First query
const q1 = query({ prompt: "Create a project structure", options });
for await (const msg of q1) { /* ... */ }
const result1 = await q1.result;
// Resume the session (continues conversation)
const q2 = query({
prompt: "Now add tests",
options: {
...options,
resume: {
sessionId: result1.sessionId,
transcript: [], // SDK manages internally
},
},
});
// Fork (branch from a point)
const q3 = query({
prompt: "Try a different approach",
options: {
...options,
resume: {
sessionId: result1.sessionId,
transcript: [],
},
},
});V2 — Session Objects
import { unstable_v2_createSession, unstable_v2_resumeSession } from "@anthropic-ai/claude-agent-sdk";
// Create session
await using session = unstable_v2_createSession({
options: { model: "sonnet", systemPrompt: "You are helpful." },
});
// First turn
for await (const msg of session.stream("Build a CLI tool")) { /* ... */ }
// Second turn (same session)
for await (const msg of session.stream("Add --verbose flag")) { /* ... */ }
// Apply settings mid-session (v0.2.79+)
await session.applyFlagSettings({ permissions: { allow: ['Bash(*)'] } });
// Later: resume
await using resumed = unstable_v2_resumeSession(session.sessionId, { options });
for await (const msg of resumed.stream("Add --help flag")) { /* ... */ }Listing Sessions (v0.2.55+)
import { listSessions, type SDKSessionInfo } from "@anthropic-ai/claude-agent-sdk";
// List sessions for a specific project
const sessions: SDKSessionInfo[] = await listSessions({ dir: '/path/to/project' });
// Paginate results (v0.2.76+)
const page1 = await listSessions({ limit: 50 });
const page2 = await listSessions({ limit: 50, offset: 50 });
// Exclude git worktree sessions (v0.2.70+)
const noWorktrees = await listSessions({ dir: '/path/to/project', includeWorktrees: false });SDKSessionInfo
interface SDKSessionInfo {
sessionId: string; // Unique session identifier (UUID)
summary: string; // Display title: custom title, auto-generated summary, or first prompt
lastModified: number; // Last modified time (ms since epoch)
fileSize?: number; // File size in bytes (optional, local JSONL only; v0.2.76+)
customTitle?: string; // User-set title via /rename
firstPrompt?: string; // First meaningful user prompt
gitBranch?: string; // Git branch at session end
cwd?: string; // Working directory
tag?: string; // User-set session tag (v0.2.76+)
createdAt?: number; // Creation time in ms since epoch (v0.2.76+)
}Reading Session Messages (v0.2.59+)
Read historical messages from a session transcript.
import { getSessionMessages, type SessionMessage } from "@anthropic-ai/claude-agent-sdk";
// Read all messages from a session
const messages: SessionMessage[] = await getSessionMessages(sessionId);
// Read messages from a specific project directory
const messages2 = await getSessionMessages(sessionId, { dir: '/path/to/project' });
// Paginate through messages
const page = await getSessionMessages(sessionId, { limit: 20, offset: 0 });SessionMessage
interface SessionMessage {
type: 'user' | 'assistant';
uuid: string;
session_id: string;
message: unknown;
parent_tool_use_id: null;
}Session Mutation Functions (v0.2.76+)
import { forkSession, getSessionInfo, renameSession, tagSession } from "@anthropic-ai/claude-agent-sdk";
// Fork a session into a new branch with fresh UUIDs
const { sessionId: forkedId } = await forkSession(sessionId, {
upToMessageId: "msg-uuid", // Optional: branch from specific point
title: "My fork", // Optional: custom title
});
// Read metadata for a single session (lighter than listSessions)
const info = await getSessionInfo(sessionId, { dir: '/path/to/project' });
// Rename a session
await renameSession(sessionId, "New Title", { dir: '/path/to/project' });
// Tag or untag a session
await tagSession(sessionId, "important");
await tagSession(sessionId, null); // Clear tagFile Checkpointing
const q = query({
prompt: "Refactor the codebase",
options: {
enableFileCheckpointing: true,
},
});
// If something goes wrong, rewind all file changes
q.rewindFiles();Hooks
Event hooks let you react to SDK lifecycle events. Added incrementally across versions.
Hook Events
| Event | Since | Description |
PreToolUse | v0.2.0 | Before a tool is executed |
PostToolUse | v0.2.0 | After a tool completes |
Notification | v0.2.15 | Agent sends a notification |
PermissionRequest | v0.2.15 | Permission prompt triggered |
Stop | v0.2.0 | Agent stops |
StopFailure | v0.2.79 | Agent stop failed due to error (includes error, error_details?, last_assistant_message?) |
SubagentStop | v0.2.0 | Subagent stops |
TeammateIdle | v0.2.33 | Teammate goes idle |
TaskCompleted | v0.2.33 | Task marked complete |
Elicitation | v0.2.63 | MCP server requests user input (form or URL auth) |
ElicitationResult | v0.2.63 | Elicitation response sent back to MCP server |
ConfigChange | v0.2.50 | Configuration file changed (source: user/project/local/policy/skills) |
WorktreeCreate | v0.2.50 | Git worktree created |
WorktreeRemove | v0.2.50 | Git worktree removed |
PostCompact | v0.2.76 | After context compaction completes (includes trigger: 'manual' or 'auto', and compact_summary) |
InstructionsLoaded | v0.2.70 | CLAUDE.md / memory file loaded (includes file_path, memory_type, load_reason: 'session_start' | 'nested_traversal' | 'path_glob_match' | 'include' | 'compact' (v0.2.79+)) |
Hook Command Configuration
Hook commands support a shell field (v0.2.81+) to select the shell interpreter: 'bash' (default, uses $SHELL) or 'powershell' (uses pwsh).
Hook Configuration
const q = query({
prompt: "Do the task",
options: {
hooks: {
PreToolUse: [
{
matcher: "Bash",
handler: async (event) => {
console.log(`Running: ${event.toolInput.command}`);
return { proceed: true }; // or { proceed: false, reason: "blocked" }
},
},
],
PostToolUse: [
{
matcher: "*", // Match all tools
handler: async (event) => {
console.log(`Tool ${event.toolName} completed`);
},
},
],
Notification: [
{
handler: async (event) => {
console.log(`Notification: ${event.message}`);
},
},
],
},
},
});Structured Output
Force Claude to return structured data using Zod schemas.
import { query } from "@anthropic-ai/claude-agent-sdk";
import { z } from "zod";
const q = query({
prompt: "Analyze this code for bugs",
options: {
outputFormat: {
type: "json",
schema: z.object({
bugs: z.array(z.object({
file: z.string(),
line: z.number(),
severity: z.enum(["low", "medium", "high", "critical"]),
description: z.string(),
fix: z.string(),
})),
summary: z.string(),
}),
},
maxTurns: 5,
},
});
for await (const msg of q) {
if (msg.type === "result") {
const parsed = JSON.parse(msg.content);
// parsed is typed according to schema
}
}Sandbox Settings
Configure sandbox behavior for safe execution.
const q = query({
prompt: "Run the test suite",
options: {
sandbox: {
type: "docker", // "docker" | "none"
image: "node:20-slim",
network: false, // Disable network
mountPaths: ["/app"], // Paths to mount
maxMemory: "512m",
maxCpus: 2,
filesystem: { // Filesystem restrictions (v0.2.50+)
allowWrite: ["/app/src"], // Directories allowed for writes
denyWrite: ["/app/node_modules"], // Directories denied for writes
denyRead: ["/app/.env"], // Directories denied for reads
allowRead: ["/app/.env.example"], // Re-allow reading within denyRead regions (v0.2.79+)
allowManagedReadPathsOnly: false, // When true, only allowRead paths from policySettings are used (v0.2.79+)
},
},
},
});Note (v0.2.63+): Sandbox config schemas (SandboxSettingsSchema, SandboxFilesystemConfigSchema, SandboxNetworkConfigSchema) are now factory functions — call SandboxSettingsSchema() instead of using them directly.
SDKMessage Types
The async generator yields these message types:
type SDKMessage =
| { type: "assistant"; content: string } // Text from Claude
| { type: "tool_use"; toolName: string; toolInput: Record<string, unknown> }
| { type: "tool_result"; toolName: string; content: string }
| { type: "system"; content: string } // System messages
| { type: "system"; subtype: "task_started"; task_id: string; description: string; prompt?: string; uuid: string; session_id: string } // (v0.2.50+, uuid/session_id v0.2.51+, prompt v0.2.76+)
| { type: "system"; subtype: "task_progress"; task_id: string; description: string; usage: { total_tokens: number; tool_uses: number; duration_ms: number }; last_tool_name?: string } // (v0.2.51+)
| { type: "error"; error: string; code?: string }
| { type: "result"; content: string; sessionId: string }
| { type: "progress"; progress: number; total?: number }
| { type: "system"; subtype: "local_command_output"; content: string } // Local slash command output (v0.2.63+)
| { type: "system"; subtype: "elicitation_complete"; mcp_server_name: string; elicitation_id: string } // MCP elicitation completed (v0.2.63+)
| { type: "system"; subtype: "api_retry"; attempt: number; max_retries: number; retry_delay_ms: number; error_status: number | null; error: SDKAssistantMessageError } // API retry event (v0.2.79+)
| { type: "rate_limit_event"; rate_limit_info: SDKRateLimitInfo } // Rate limit event with details (v0.2.63+)
| { type: "prompt_suggestion"; suggestion: string }; // Prompt suggestion (v0.2.50+)Filtering Messages
for await (const msg of q) {
switch (msg.type) {
case "assistant":
process.stdout.write(msg.content);
break;
case "tool_use":
console.log(`Using tool: ${msg.toolName}`);
break;
case "tool_result":
console.log(`Result: ${msg.content.slice(0, 100)}`);
break;
case "error":
console.error(`Error: ${msg.error}`);
break;
}
}Beta Features
1M Context Window
const q = query({
prompt: "Analyze this entire codebase",
options: {
betaFeatures: ["context-1m-2025-08-07"],
contextWindow: 1_000_000,
},
});Error Handling
Exit / Stop Reasons
| Reason | Meaning |
"end_turn" | Normal completion |
"max_turns" | Reached maxTurns limit |
"interrupt" | q.interrupt() was called |
"error" | An error occurred |
"tool_error" | A tool execution failed |
Comprehensive Error Handling
try {
const q = query({ prompt, options });
for await (const msg of q) {
if (msg.type === "error") {
console.error(`SDK Error [${msg.code}]: ${msg.error}`);
}
}
const result = await q.result;
console.log(`Completed: ${result.stop_reason}, cost: $${result.totalCost.toFixed(4)}`);
} catch (error) {
if (error instanceof Error) {
// Connection errors, auth errors, etc.
console.error("Fatal:", error.message);
}
} finally {
// Cleanup if needed
q?.close();
}Known Issues & Workarounds
| Issue | Workaround |
maxTurns: 1 may not stop after first turn | Use maxTurns: 2 or q.interrupt() as fallback |
| MCP stdio servers may hang on exit | Set timeout on child process, use q.close() |
resume requires matching model | Always pass same model when resuming |
bypassPermissions still blocked in Docker | Ensure Docker socket is accessible |
V2 receive() renamed to stream() | Use stream() for v0.2.72+, receive() for older |
Large systemPrompt reduces effective context | Keep system prompts concise, use CLAUDE.md for context |
canUseTool not called for MCP tools | Known limitation — use allowedTools/disallowedTools instead |
Settings Priority
Settings are loaded in order (later overrides earlier):
- Default — SDK built-in defaults
- User —
~/.claude/settings.json - Project —
.claude/settings.jsonin working directory - Local —
.claude/settings.local.jsonin working directory - Query options — Options passed to
query()(highest priority)
Version History (Recent)
| Version | Key Change |
| v0.2.81 | Exported SDKControlRequest/SDKControlResponse types, initialUserMessage query option, shell field on hook commands ('bash' | 'powershell'), new settings: defaultShell, strictPluginOnlyCustomization, showClearContextOnPlanAccept, autoDreamEnabled, inline source: 'settings' marketplace declarations |
| v0.2.79 | StopFailure hook event, SDKAPIRetryMessage message type, applyFlagSettings() session method, apiProvider field, allowRead/allowManagedReadPathsOnly sandbox options, 'resume' exit reason, 'compact' load_reason for InstructionsLoaded, title/displayName/description on permission requests, timestamp on task messages |
| v0.2.76 | PostCompact hook event, forkSession()/getSessionInfo()/renameSession()/tagSession() session functions, agentProgressSummaries option, offset pagination for listSessions(), tag/createdAt fields on SDKSessionInfo, AgentDefinition.model widened to string, sparsePaths worktree option, prompt field on task_started messages |
| v0.2.70 | InstructionsLoaded hook event, agent_id/agent_type on hook inputs, toolConfig + settings query options, includeWorktrees on listSessions, exported Settings and ToolConfig types, SDKControlGetSettingsRequest, priority field on task messages, enableWeakerNetworkIsolation sandbox option, supportsFastMode model field |
| v0.2.63 | MCP elicitation support (onElicitation callback, ElicitationRequest/ElicitationResult types), Elicitation/ElicitationResult hook events, AgentInfo type + supportedAgents() method, FastModeState type, SDKLocalCommandOutputMessage/SDKElicitationCompleteMessage message types, SDKRateLimitInfo type, sandbox schemas changed to factory functions |
| v0.2.59 | getSessionMessages() function, GetSessionMessagesOptions type, SessionMessage type for reading session transcripts |
| v0.2.55 | listSessions() function, ListSessionsOptions type, SDKSessionInfo type for session discovery |
| v0.2.52 | Maintenance release |
| v0.2.51 | SDKTaskProgressMessage type, new fields on SDKTaskStartedMessage (uuid, session_id), MCP auth control requests |
| v0.2.50 | New hook events (ConfigChange, WorktreeCreate, WorktreeRemove), ThinkingConfig types, promptSuggestions option, sandbox filesystem config, SDKTaskStartedMessage, removed delegate permission mode |
| v0.2.33 | TeammateIdle/TaskCompleted hooks, custom sessionId |
| v0.2.31 | stop_reason in QueryResult |
| v0.2.30 | debug/debugFile options |
| v0.2.27 | Tool annotations (readOnlyHint, destructiveHint, etc.) |
| v0.2.21 | MCP introspection (reconnectMcpServer, toggleMcpServer) |
| v0.2.19 | additionalDirectories for CLAUDE.md |
| v0.2.15 | Notification hooks, close() method |
Based on claude-agent-sdk skill by Jeremy Dawes (jezweb/claude-skills, MIT License). Updated and expanded for SDK v0.2.81.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

