跳到正文
arXiv:cs.AI· Jiacheng Liu, Xiaohan Zhao, Xinyi Shang, Zhiqiang Shen·· 18 小时前

深入解析 Claude Code:当下与未来 AI 智能体系统的设计空间

Dive into Claude Code: The Design Space of Today's and Future AI Agent Systems

AI 导读

一项技术报告通过分析公开源码,拆解了 Claude Code 的架构,并与 OpenClaw、Hermes Agent 两个开源 AI 智能体系统对比。Claude Code 核心是调用模型、运行工具并循环的 while-loop,外围包含七种模式的权限系统与 ML 分类器、五层上下文压缩管线、MCP/插件/技能/钩子四类扩展机制及子智能体编排。报告还提出未来智能体系统的六个开放设计方向。

正文

View PDF HTML (experimental)

Abstract:Claude Code is an agentic coding tool that can run shell commands, edit files, and call external services on behalf of the user. This study describes its architecture by analyzing the publicly available source code and comparing it with two independent open-source AI agent systems, OpenClaw and Hermes Agent, that answer many of similar or even the same design questions. Our analysis identifies five human values, philosophies, and needs that motivate the architecture: human decision authority, safety, security, and privacy, reliable execution, capability amplification, and contextual adaptability. We then trace them through thirteen design principles to implementation choices. The core of the system is a simple while-loop that calls the model, runs tools, and repeats. Most of the code, however, lives in the systems around this loop: a permission system with seven modes and an ML-based classifier, a five-layer compaction pipeline for context management, four extensibility mechanisms (MCP, plugins, skills, and hooks), a subagent delegation and orchestration mechanism, and append-oriented session storage. Comparisons with OpenClaw and Hermes Agent show that the same design questions produce different answers across three deployment contexts. Claude Code emphasizes per-action safety, OpenClaw emphasizes perimeter-level access, and Hermes renders per-action approvals across many surfaces. At the runtime layer, Claude Code uses a single CLI loop, OpenClaw embeds the runtime within a gateway control plane, and Hermes uses one process whose role is set by its entry point. At the context and extension layer, Claude Code extends the context window, OpenClaw registers gateway-wide capabilities, and Hermes provides pluggable memory and model backends. We finally identify six open design directions for future agent systems, grounded in recent empirical, architectural, and policy literature.
Comments: Tech report. Code at: this https URL
Subjects: Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Computation and Language (cs.CL); Machine Learning (cs.LG)
Cite as: arXiv:2604.14228 [cs.SE]
  (or arXiv:2604.14228v3 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2604.14228

arXiv-issued DOI via DataCite

Submission history

From: Jiacheng Liu [view email]
[v1] Tue, 14 Apr 2026 17:59:37 UTC (573 KB)
[v2] Thu, 2 Jul 2026 17:12:13 UTC (585 KB)
[v3] Sat, 10 Oct 2026 17:26:32 UTC (602 KB)

来源:arXiv:cs.AI · arxiv.org