源码地址 https://github.com/Rito-w/ClaudeCode https://github.com/sanbuphy/claude-code-source-code https://github.com/ChinaSiro/claude-code-sourcemap 备份下载 https://pan.quark.cn/s/84653a4f7bed
Claude Code 的核心不在于模型能力,而在于:
如何把 LLM 变成“可执行系统”
它完成了三件关键事情:

下面是基于源码 + sourcemap 还原的完整架构:

自然语言 → 结构化任务图这是 Claude Code 的“智能来源”。

Claude Code 并非单 Agent,而是一个“团队”:


LLM 不直接做事 → Tool 才执行


Claude Code 真正“动手”的地方:
模块 | 作用 |
|---|---|
File System | 读写代码 |
Git | 提交、diff |
Shell | 执行命令 |
Search | 查找代码 |
LLM → Tool → Observation → LLMGoal → Task Graph → ExecutionEverything is a ToolAgent Team ≈ 软件工程团队Memory ≈ 自动上下文管理系统结合你的技术背景(Agent / RAG / 后端系统),可以按这个路线实现:
while True:
action = llm(prompt)
if action.tool:
result = tool(action)
else:
breaktools = {
"read_file": read_file,
"write_file": write_file,
"run_cmd": run_cmd
}User Goal → Task ListPlanner / Coder / Reviewer可以压缩为一句话:
Claude Code = LLM + Tool System + Task Graph + Agent Loop
或者更工程一点:
AI Agent OS = Planner + Scheduler + Tool Runtime + Memory