agentleFS
flaremityflaremity/skills/skills/claude-agent-sdk-ts/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    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.

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
  1. Distinctive:

    Read historical messages from a session transcript.

    line 492

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude Agent SDK — TypeScript Reference

Package: @anthropic-ai/claude-agent-sdk@0.2.81 Runtime: 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-sdk
import { 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 iteration

Query Methods

MethodDescription
q.supportedAgents()Promise<AgentInfo[]> — list available subagents (v0.2.63+)
q.resultPromise<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: QueryResult

Multi-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 from receive() in v0.2.72+). Sessions implement AsyncDisposable — use await using for automatic cleanup.


Options Reference

QueryOptions

OptionTypeDefaultDescription
promptstringrequiredThe user prompt
options.modelstring"sonnet"Model alias ("sonnet", "opus", "haiku") or full model ID ("claude-opus-4-5")
options.systemPromptstringundefinedSystem prompt prepended to conversation
options.appendSystemPromptstringundefinedAppended after default system prompt
options.maxTurnsnumberInfinityMax agentic turns (API round-trips)
options.permissionModePermissionMode"default""default" | "acceptEdits" | "bypassPermissions" | "plan"
options.canUseTool(tool, input) => DecisionundefinedPer-tool permission callback
options.toolsTool[][]Custom tools via tool() helper
options.mcpServersMCPServerConfig[][]MCP server connections
options.subagentsAgentDefinition[][]Subagent definitions
options.allowedToolsstring[]undefinedWhitelist of tool names
options.disallowedToolsstring[]undefinedBlacklist of tool names
options.cwdstringprocess.cwd()Working directory
options.sessionIdstringauto-generatedCustom session ID (added v0.2.33)
options.resume{ sessionId, transcript }undefinedResume a previous session
options.contextWindownumbermodel defaultContext window size in tokens
options.maxCachePointsnumberundefinedMax prompt caching breakpoints
options.debugbooleanfalseEnable debug logging (added v0.2.30)
options.debugFilestringundefinedWrite debug logs to file (added v0.2.30)
options.enableFileCheckpointingbooleanfalseEnable file state checkpointing
options.outputFormatOutputFormatundefinedStructured output format
options.sandboxSandboxSettingsundefinedSandbox configuration
options.additionalDirectoriesstring[][]Extra dirs for CLAUDE.md loading (added v0.2.19)
options.betaFeaturesstring[][]Beta feature flags
options.thinkingThinkingConfigundefinedThinking/reasoning behavior: { type: 'adaptive' }, { type: 'enabled', budgetTokens?: number }, or { type: 'disabled' } (v0.2.50+)
options.promptSuggestionsbooleanundefinedEnable prompt suggestions after each turn (v0.2.50+)
options.hooksHookConfigundefinedEvent hook configuration
options.onElicitationOnElicitationundefinedCallback for MCP elicitation requests — called when an MCP server requests user input and no hook handles it (v0.2.63+)
options.toolConfigToolConfigundefinedPer-tool configuration for built-in tools, e.g. { askUserQuestion: { previewFormat: 'html' } } (v0.2.70+)
options.settingsstring | SettingsundefinedAdditional settings (path to JSON or object) — loaded as highest-priority "flag settings" layer (v0.2.70+)
options.agentProgressSummariesbooleanfalseEnable periodic AI-generated progress summaries for running subagents — emits summary field on task_progress events (v0.2.76+)
options.initialUserMessagestringundefinedInitial user message to prefill the conversation context (v0.2.81+)

Permission Modes

ModeBehavior
"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 reason
  • undefined — 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);  // enable

Subagents

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 tag

File 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

EventSinceDescription
PreToolUsev0.2.0Before a tool is executed
PostToolUsev0.2.0After a tool completes
Notificationv0.2.15Agent sends a notification
PermissionRequestv0.2.15Permission prompt triggered
Stopv0.2.0Agent stops
StopFailurev0.2.79Agent stop failed due to error (includes error, error_details?, last_assistant_message?)
SubagentStopv0.2.0Subagent stops
TeammateIdlev0.2.33Teammate goes idle
TaskCompletedv0.2.33Task marked complete
Elicitationv0.2.63MCP server requests user input (form or URL auth)
ElicitationResultv0.2.63Elicitation response sent back to MCP server
ConfigChangev0.2.50Configuration file changed (source: user/project/local/policy/skills)
WorktreeCreatev0.2.50Git worktree created
WorktreeRemovev0.2.50Git worktree removed
PostCompactv0.2.76After context compaction completes (includes trigger: 'manual' or 'auto', and compact_summary)
InstructionsLoadedv0.2.70CLAUDE.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

ReasonMeaning
"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

IssueWorkaround
maxTurns: 1 may not stop after first turnUse maxTurns: 2 or q.interrupt() as fallback
MCP stdio servers may hang on exitSet timeout on child process, use q.close()
resume requires matching modelAlways pass same model when resuming
bypassPermissions still blocked in DockerEnsure Docker socket is accessible
V2 receive() renamed to stream()Use stream() for v0.2.72+, receive() for older
Large systemPrompt reduces effective contextKeep system prompts concise, use CLAUDE.md for context
canUseTool not called for MCP toolsKnown limitation — use allowedTools/disallowedTools instead

Settings Priority

Settings are loaded in order (later overrides earlier):

  1. Default — SDK built-in defaults
  2. User — ~/.claude/settings.json
  3. Project — .claude/settings.json in working directory
  4. Local — .claude/settings.local.json in working directory
  5. Query options — Options passed to query() (highest priority)

Version History (Recent)

VersionKey Change
v0.2.81Exported 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.79StopFailure 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.76PostCompact 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.70InstructionsLoaded 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.63MCP 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.59getSessionMessages() function, GetSessionMessagesOptions type, SessionMessage type for reading session transcripts
v0.2.55listSessions() function, ListSessionsOptions type, SDKSessionInfo type for session discovery
v0.2.52Maintenance release
v0.2.51SDKTaskProgressMessage type, new fields on SDKTaskStartedMessage (uuid, session_id), MCP auth control requests
v0.2.50New hook events (ConfigChange, WorktreeCreate, WorktreeRemove), ThinkingConfig types, promptSuggestions option, sandbox filesystem config, SDKTaskStartedMessage, removed delegate permission mode
v0.2.33TeammateIdle/TaskCompleted hooks, custom sessionId
v0.2.31stop_reason in QueryResult
v0.2.30debug/debugFile options
v0.2.27Tool annotations (readOnlyHint, destructiveHint, etc.)
v0.2.21MCP introspection (reconnectMcpServer, toggleMcpServer)
v0.2.19additionalDirectories for CLAUDE.md
v0.2.15Notification 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.