Claude Agent SDK

Paket

Claude Code's agent loop and built-in tools as a Python and TypeScript library

Fiyat
Free SDK; Claude API usage is billed
Erişim
Anthropic API key

Hakkında

The Claude Agent SDK packages Claude Code as a library: an agent loop with file, shell and web tools, hooks, subagents, MCP and sessions. It runs in a process you operate and works only with Claude models, billed as Claude API usage.

Neler yapabilirsin

  • Build a coding agent that reads, edits and fixes files in a repo
  • Automate tasks with shell commands, web search and MCP tools
  • Run subagents with hooks and permission controls in your own app

Başlarken

  1. Install @anthropic-ai/claude-agent-sdk or pip install claude-agent-sdk
  2. Set ANTHROPIC_API_KEY in your environment

Örnek kod

import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "Review utils.py for bugs that would cause crashes. Fix any issues you find.",
  options: { allowedTools: ["Read", "Edit", "Glob"], permissionMode: "acceptEdits" },
})) {
  if (message.type === "result") console.log(`Done: ${message.subtype}`);
}

Ayrıntılar

Barındırma
Kendi bilgisayarında
Kullanılabildiği yerler
Tüm dünya
Resmi SDK'lar
Python, JavaScript/TypeScript
MCP sunucusu
Yok
Entegrasyonlar
Claude

Görevler

Alternatifler

Aynı görevler için başka araçlar.

Son kontrol: .