What problem does it solve?
This Skill provides a comprehensive reference for the Anthropic Agent SDK (TypeScript), enabling developers to programmatically interact with Claude Code and integrate custom tools. It simplifies building sophisticated AI applications by offering detailed documentation on functions, types, and configuration options.
Core Features & Use Cases
- Programmatic Interaction: Use
query() to send prompts, stream responses, and manage multi-turn conversations directly from your TypeScript application.
- Custom Tooling: Define type-safe MCP tools with
tool() and host them in-process using createSdkMcpServer().
- Use Case: When building a custom AI agent that needs to interact with Claude Code, integrate with internal systems via custom tools, or automate complex development workflows, this Skill provides all the necessary technical details to get started and build robust solutions.
Quick Start
Install the SDK
npm install @anthropic-ai/claude-agent-sdk
Basic query example
import { query } from '@anthropic-ai/claude-agent-sdk';
const result = query({ prompt: "Analyze this code" });
for await (const message of result) {
if (message.type === 'assistant') {
console.log(message.message.content);
}
}