Skip to content

Claude Agent SDK

Independent TypeScript SDK for agent loops, tools, permissions, and streaming events.

Agent loop

Maintains conversation state, calls an Anthropic-compatible model, runs tools, and feeds results back to the model.

Custom tools

Define tools with Zod schemas, parsed inputs, typed handlers, and model-ready JSON Schema.

Permission callbacks

Approve or deny tool calls before execution, including shell and file operations.

Stable events

Consume system, assistant, user, stream_event, and result messages.

Terminal window
npm install @npm-while1/claude-agent-sdk zod

The SDK is intentionally independent from Claude Code. It does not require the Claude Code CLI, Ink UI, session storage, MCP runtime, or app runtime.