Seven Mental · 心智七篇
← Knowledge Atlas · Entity

Claude Agent SDK

Anthropic 的 agent 开发框架
ENTITY · CLAUDE AGENT SDK · formerly Claude Code SDK · “give the agent a computer”

Claude Agent SDK

Anthropic’s agent development framework — formerly Claude Code SDK, lets agents use computers to get work done

Design philosophy: “give the agent a computer”. The SDK lets agents use the file system, terminal, and tools — the same way humans use a computer. It runs on an implicit-loop architecture: gather context → take action → verify work → repeat. Behavior is shaped by tools, prompts, permissions, and feedback rather than a predefined graph.

Implicit-loop architecture
Gather Context
Take Action
Verify Work
Repeat
Behavior shaped by constraints, not by a preset path — tools/prompts/permissions/feedback determine it jointly
Long-running capability and limits
Built-in compaction
When context nears the limit, history is automatically compacted so work continues — a built-in SDK capability
Compaction alone is not enough
Anthropic’s practice: externalized progress tracking is also needed (progress file + git history + feature tracking)
Two-agent architecture
An Initializer-Coder two-agent setup is what makes reliable cross-session work possible
With MCP
Claude Agent SDK + MCP tool invocation is the recommended agent-development combination
→ Harness Engineering · Implicit Loop Architecture · Context ManagementAnthropic (2024)

Claude Agent SDK

Anthropic 的 agent 开发框架(原 Claude Code SDK)。

概述

Building Effective Agents 中作为推荐的实现框架被提及。属于让开发者更容易构建 agentic systems 的工具之一。

设计哲学

核心原则:“给 agent 一台计算机”。SDK 让 agent 能使用文件系统、终端、工具来完成工作——与人类使用计算机的方式一致。运行在 隐式循环架构 上:gather context → take action → verify work → repeat,行为由工具、prompt、权限和反馈机制约束,而非预定义图。详见 SDK 官方介绍

长时运行能力

SDK 内建 context management 能力(如 compaction),使 agent 可以在 context 接近上限时压缩历史继续工作。但 Anthropic 在 长时运行 agent 实践 中发现,仅有 compaction 不够——还需要外部化的进度追踪(progress file + git history + feature tracking)和 harness 层面的设计(initializer-coder 双 agent 架构)才能实现可靠的跨 session 工作。

相关实体

  • Anthropic — 开发方
  • MCP — 配合使用的上下文协议

References

  • sources/anthropic_official/building-effective-agents.md
  • sources/anthropic_official/effective-harnesses-long-running-agents.md
  • sources/anthropic_official/harness-design-long-running-apps.md
  • sources/anthropic_official/building-agents-claude-agent-sdk.md