Claude Agent SDK
The Claude Agent SDK is a software development kit provided by Anthropic to help developers build custom AI agents based on the Claude Code Agent Harness framework. The SDK supports both Python and TypeScript, providing standardized interfaces and toolchains that enable developers to extend and customize AI agent behaviors and capabilities. It is applicable to scenarios such as automated task execution and workflow orchestration.
Core Facts
Agent Skills is a capability encapsulation standard released by Anthropic, defined as a directory containing a Skill.md file that can include instructions, scripts, and other resources.
The core interface of the Agent SDK is a query() function; passing in a prompt and configuration starts the agent loop, and key configuration items include settingSources, allowedTools and systemPrompt.
Both the Claude Agent SDK and the OpenAI Agents SDK take over the Agent Loop, greatly simplifying the model invocation, tool dispatching, history maintenance, and loop control logic that previously had to be written by hand.
Timeline (last 90 days)
The video author mentions that the Claude Agent SDK lacks a model routing mechanism similar to K9-AIF's.
K9-AIF is compatible with CrewAI, LangGraph, the Claude Agent SDK and the OpenAI Agents SDK.
There are two paths to building a harness in TypeScript or Python: use the Claude Agent SDK, or write a bare tool-calling loop directly against the Anthropic Messages API, OpenAI, or Ollama-compatible endpoints.
In the Agent SDK, structured output can be enforced by passing an output format plus a JSON schema, and in Ollama or OpenAI-compatible APIs the response_format parameter can be passed.
When using the Agent SDK, call query with the prompt and options, then iterate over the asynchronous message stream; each round produces assistant thinking and tool calls, and finally ends with a result message reporting the final answer, the number of rounds, and the dollar cost.
The Agent SDK comes with file editing, search, shell execution, MCP support, and context management features.
When Max turns is set to 3 in the Claude Agent SDK, a run of five calls stops after the 3rd turn and throws an error, resulting in the fix being completed but never tested, with no final answer.
The underlying engine that drives Claude Code is the same engine as the Claude Agent SDK; the SDK merely wraps that engine for developers to build their own agents.
Each employee in Crewloft runs Claude Code invoked through the Claude Agent SDK.
The Claude Agent SDK runs Claude Code itself, with one process per session; officially only Claude models are supported.
40 more timeline events
All Facts (20)
Agent Skills is a capability encapsulation standard released by Anthropic, defined as a directory containing a Skill.md file that can include instructions, scripts, and other resources.
80%VerifiedThe core interface of the Agent SDK is a query() function; passing in a prompt and configuration starts the agent loop, and key configuration items include settingSources, allowedTools and systemPrompt.
65%VerifiedBoth the Claude Agent SDK and the OpenAI Agents SDK take over the Agent Loop, greatly simplifying the model invocation, tool dispatching, history maintenance, and loop control logic that previously had to be written by hand.
65%VerifiedAgent SDK is a development toolkit written in TypeScript and Python, and is the core component powering the Claude Code backend
65%VerifiedClaude Agent SDK supports multi-step reasoning, tool calls, and environment interaction, including capabilities such as code writing, file operations, and command execution.
65%VerifiedThe Claude Agent SDK has built-in tools such as Web Search and Web Fetch, giving the Agent the ability to search the internet and scrape web pages.
65%Unverifiedclaude-memory-compiler采用三层自动化流水线架构:会话捕获层(Hooks机制)、知识提取层(Claude Agent SDK)和知识编译层(LLM Compiler)
90%UnverifiedAll data and inference in this solution are completed locally and will not be transmitted to third-party servers, making it suitable for enterprise scenarios with strict data privacy requirements.
90%Unverified通过设置环境变量ANTHROPIC_BASE_URL指向LiteLLM Proxy的本地端口,可以将Claude Agent SDK的请求重定向到本地模型,无需修改SDK源码
90%Unverified2024-2025年,Anthropic Claude Agent SDK、OpenAI Agents SDK、Google ADK等Agent框架集中涌现
85%UnverifiedClaude Agent SDK提供工具注册与调用、多轮对话上下文管理、智能体间消息传递与协调机制以及结构化输出控制等能力
85%UnverifiedDecoupling framework capability from reasoning capability is an important trend in the AI engineering field; the Claude Agent SDK provides an agent orchestration framework, and the actual reasoning can be completed by any compatible model.
75%UnverifiedFramework selection advice: choose LangGraph for explicit control over complex branching and state, choose CrewAI for building teams of specialist Agents that hand off to each other, choose OpenAI Agents SDK for locking into OpenAI models with minimal overhead, and choose Claude Agent SDK for autonomous work involving code and files across multiple steps.
60%UnverifiedIn the agent context, a single turn may contain multiple tool calls, and the SDK executes them sequentially and appends each step's result to the context until Claude decides to stop calling tools.
60%UnverifiedThe overall architecture of this solution is divided into three layers: the Agent Framework layer (task management and scheduling), the Claude Agent SDK layer (core Worker), and the LiteLLM Proxy layer (request proxy forwarding).
60%UnverifiedThe solution of connecting the Claude Agent SDK to a local large model via LiteLLM Proxy can reduce API call costs from nearly $1 per simple task to almost zero.
60%UnverifiedThe video author mentions that the Claude Agent SDK lacks a model routing mechanism similar to K9-AIF's.
50%UnverifiedK9-AIF is compatible with CrewAI, LangGraph, the Claude Agent SDK and the OpenAI Agents SDK.
50%UnverifiedThere are two paths to building a harness in TypeScript or Python: use the Claude Agent SDK, or write a bare tool-calling loop directly against the Anthropic Messages API, OpenAI, or Ollama-compatible endpoints.
50%UnverifiedThe Agent SDK comes with file editing, search, shell execution, MCP support, and context management features.
50%