claude-agent-sdk-typescript
Expert guidance for building AI agents with the Claude Agent SDK in TypeScript/JavaScript. Use when the user writes TypeScript or JavaScript code with the SDK, imports from "@anthropic-ai/claude-agent-sdk", uses query(), allowedTools, permissionMode, creates custom tools with createSdkMcpServer, sets up hooks, integrates MCP servers, manages sessions, or debugs SDK issues in TypeScript/Node.js. Also triggers on: "@anthropic-ai/claude-agent-sdk", "allowedTools", "permissionMode", "npm install", "for await", "AgentDefinition", or "settingSources".
npx skills add majiayu000/claude-skill-registry --skill claude-agent-sdk-typescript --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Claude Agent SDK — TypeScript Guide Production guidance for building AI agents with the Claude Agent SDK in TypeScript. > **Naming**: The Claude Code SDK was renamed to the Claude Agent SDK (v0.1.0+). > Package: `npm install @anthropic-ai/claude-agent-sdk` · Import: `import { query } from "@anthropic-ai/claude-agent-sdk"` ## Quick Reference — Two Interaction Modes ### 1. `query()` — Stateless, One-Shot Best for: independent tasks, automation scripts, CI pipelines. ```typescript import { query, type ClaudeAgentOptions } from "@anthropic-ai/claude-agent-sdk"; const options: ClaudeAgentOptions = { allowedTools: ["Read", "Edit", "Glob"], permissionMode: "acceptEdits", }; for await (const message of query({ prompt: "Review utils.ts for bugs. Fix any issues you find.", options, })) { if (message.type === "assistant") { for (const block of message.message.content) { if ("text" in block) console.log(block.text); else if ("name" in block) console.log(`Tool: ${block.name}`); } } if (message.type === "result") { console.log(`Done: ${message.subtype}`); } } ``` ### 2. `ClaudeSDKClient` — Stateful, Multi-Turn Best for: conversations, follow-up questions, interactive apps. ```typescript import
- Quick Reference — Two Interaction Modes
- 1. query() — Stateless, One-Shot
- 2. ClaudeSDKClient — Stateful, Multi-Turn
- ClaudeAgentOptions — Complete Configuration
- Built-in Tools
- Custom Tools via SDK MCP Server
- Subagents
- Hooks — Lifecycle Callbacks
- MCP Integration (External Servers)
- Using Skills in the SDK
- Sessions and Conversation Management
- System Prompt Configuration
- Authentication
- Common Patterns
Direct API (default) export ANTHROPIC_API_KEY=your-api-key Amazon Bedrock export CLAUDE_CODE_USE_BEDROCK=1 Google Vertex AI export CLAUDE_CODE_USE_VERTEX=1 Microsoft Azure AI Foundry export CLAUDE_CODE_USE_FOUNDRY=1
What does the claude-agent-sdk-typescript skill do?
Expert guidance for building AI agents with the Claude Agent SDK in TypeScript/JavaScript. Use when the user writes TypeScript or JavaScript code with the SDK, imports from "@anthropic-ai/claude-agent-sdk", uses query(), allowedTools, permissionMode, creates custom tools with createSdkMcpServer, sets up hooks, integrates MCP servers, manages sessions, or debugs SDK issues in TypeScript/Node.js. Also triggers on: "@anthropic-ai/claude-agent-sdk", "allowedTools", "permissionMode", "npm install", "for await", "AgentDefinition", or "settingSources".
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill claude-agent-sdk-typescript --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
