Skip to content

Commit f71f6c3

Browse files
committed
Add comprehensive s20 harness chapter
1 parent 6395756 commit f71f6c3

10 files changed

Lines changed: 3129 additions & 26 deletions

File tree

README-ja.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Claude Code = 一つの agent loop
106106

107107
これがすべてだ。これが全アーキテクチャ。すべてのコンポーネントは Harness メカニズム -- Agent が住む世界の一部。Agent そのものは? Claude だ。モデル。Anthropic が人類の推論とコードの全幅で訓練した。Harness が Claude を賢くしたのではない。Claude は元々賢い。Harness が Claude に手と目とワークスペースを与えた。
108108

109-
これが Claude Code が理想的な教材である理由だ:**モデルを信頼し、工学的努力を Harness に集中させるとどうなるかを示している。** このリポジトリの各セッション(s01-s19)は Claude Code アーキテクチャから一つの Harness メカニズムをリバースエンジニアリングする。終了時には、Claude Code の仕組みだけでなく、あらゆるドメインのあらゆる Agent に適用される Harness 工学の普遍的原則を理解している。
109+
これが Claude Code が理想的な教材である理由だ:**モデルを信頼し、工学的努力を Harness に集中させるとどうなるかを示している。** このリポジトリの各セッション(s01-s20)は Claude Code アーキテクチャの Harness メカニズムを段階的に分解し、最後に組み直す。終了時には、Claude Code の仕組みだけでなく、あらゆるドメインのあらゆる Agent に適用される Harness 工学の普遍的原則を理解している。
110110

111111
教訓は「Claude Code をコピーせよ」ではない。教訓は:**最高の Agent プロダクトは、自分の仕事が Harness であって Intelligence ではないと理解しているエンジニアが作る。**
112112

@@ -159,7 +159,7 @@ Claude Code = 一つの agent loop
159159
Agent を特定ドメインで効果的にする Harness -- の作り方を教える。
160160
```
161161

162-
**19 の段階的セッション、シンプルなループから外付けプラグインまで**
162+
**20 の段階的セッション、シンプルなループから完全な Harness まで**
163163
**各セッションは 1 つの Harness メカニズムを追加する。各メカニズムには 1 つのモットーがある。**
164164

165165
> **s01**   *"One loop & Bash is all you need"* — 1つのツール + 1つのループ = エージェント
@@ -199,6 +199,8 @@ Claude Code = 一つの agent loop
199199
> **s18**   *"各自のディレクトリで作業し、互いに干渉しない"* — タスクは目標を管理、worktree はディレクトリを管理、IDで紐付け
200200
>
201201
> **s19**   *"能力不足? MCP でプラグイン"* — マルチトランスポート、チャネルルーティング、ツールプール統合
202+
>
203+
> **s20**   *"仕組みは多く、ループは一つ"* — すべての仕組みを 1 つの Harness に戻す
202204
203205
---
204206

@@ -253,8 +255,8 @@ pip install -r requirements.txt
253255
cp .env.example .env # .env を編集して ANTHROPIC_API_KEY を入力
254256

255257
python s01_agent_loop/code.py # ここから開始 — 1ループ + bash
256-
python s08_context_compact/code.py # コンテキスト圧縮(最複雑章
257-
python s_full/code.py # 総括: 全19メカニズム統合
258+
python s08_context_compact/code.py # コンテキスト圧縮(複雑章
259+
python s20_comprehensive/code.py # 終点: 全メカニズムを 1 つのループへ
258260
```
259261

260262
### Web プラットフォーム
@@ -265,7 +267,7 @@ python s_full/code.py # 総括: 全19メカニズム統合
265267
cd web && npm install && npm run dev # http://localhost:3000
266268
```
267269

268-
## 5つの段階
270+
## 6つの段階
269271

270272
| 段階 | セッション | 構築するもの |
271273
|---|---|---|
@@ -274,6 +276,7 @@ cd web && npm install && npm run dev # http://localhost:3000
274276
| **知識と回復力** | `s09-s11` | memory → prompt assembly → error recovery |
275277
| **永続的作業** | `s12-s14` | task graph → background → cron |
276278
| **マルチエージェント基盤** | `s15-s19` | teams → protocols → autonomy → worktree → MCP |
279+
| **完全な Harness** | `s20` | すべての仕組みを agent loop に統合 |
277280

278281
## 全セッション
279282

@@ -298,6 +301,7 @@ cd web && npm install && npm run dev # http://localhost:3000
298301
| [s17](./s17_autonomous_agents/) | Autonomous Agents | アイドルサイクル / 自動クレーム |
299302
| [s18](./s18_worktree_isolation/) | Worktree Isolation | `WorktreeRecord` / タスク-ディレクトリ紐付け |
300303
| [s19](./s19_mcp_plugin/) | MCP Plugin | マルチトランスポート / チャネルルーティング / ツールプール統合 |
304+
| [s20](./s20_comprehensive/) | Comprehensive Agent | すべての仕組みを 1 つのループへ |
301305
| [s_full](./s_full/) | 総括 | s01-s19 全メカニズム統合 |
302306

303307
## プロジェクト構成
@@ -313,23 +317,18 @@ learn-claude-code/
313317
s02_tool_use/
314318
...
315319
s19_mcp_plugin/
316-
s_full/ # 総括
320+
s20_comprehensive/ # 終点セッション
321+
s_full/ # 旧総括
317322
agents/ # フラットコピー、python agents/sXX.py でクイック実行
318323
skills/ # s07 で使用するスキルファイル
319324
docs/ # 旧バージョン(アーカイブ)
320325
web/ # Web 学習プラットフォーム
321326
tests/
322-
323-
---
324-
<!-- OLD CONTENT REMOVED -->
325327
```
326-
<!-- The old sections above are replaced -->
327-
328-
## 次のステップ -- 理解から出荷へ
329328

330329
## 次のステップ -- 理解から出荷へ
331330

332-
19 セッションを終えれば、Harness 工学の内部構造を完全に理解している。その知識を活かす 2 つの方法:
331+
20 セッションを終えれば、Harness 工学の内部構造を完全に理解している。その知識を活かす 2 つの方法:
333332

334333
### Kode Agent CLI -- オープンソース Coding Agent CLI
335334

README-zh.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Claude Code = 一个 agent loop
106106

107107
就这些。这就是全部架构。每一个组件都是 harness 机制 -- 为 agent 构建的栖居世界的一部分。Agent 本身呢?是 Claude。一个模型。由 Anthropic 在人类推理和代码的全部广度上训练而成。Harness 没有让 Claude 变聪明。Claude 本来就聪明。Harness 给了 Claude 双手、双眼和一个工作空间。
108108

109-
这就是 Claude Code 作为教学标本的意义:**它展示了当你信任模型、把工程精力集中在 harness 上时会发生什么。** 本仓库的每一个课程(s01-s19)都在逆向工程 Claude Code 架构中的一个 harness 机制。学完之后,你理解的不只是 Claude Code 怎么工作,而是适用于任何领域、任何 agent 的 harness 工程通用原则。
109+
这就是 Claude Code 作为教学标本的意义:**它展示了当你信任模型、把工程精力集中在 harness 上时会发生什么。** 本仓库的课程(s01-s20)逐步拆解并重组 Claude Code 架构中的 harness 机制。学完之后,你理解的不只是 Claude Code 怎么工作,而是适用于任何领域、任何 agent 的 harness 工程通用原则。
110110

111111
启示不是 "复制 Claude Code"。启示是:**最好的 agent 产品,出自那些明白自己的工作是 harness 而非 intelligence 的工程师之手。**
112112

@@ -159,7 +159,7 @@ Claude Code = 一个 agent loop
159159
让 agent 在特定领域高效工作的 harness。
160160
```
161161

162-
**19 个递进式课程, 从简单循环到外接插件**
162+
**20 个递进式课程, 从简单循环到完整 Harness**
163163
**每个课程添加一个 harness 机制。每个机制有一句格言。**
164164

165165
> **s01** &nbsp; *"One loop & Bash is all you need"* &mdash; 一个工具 + 一个循环 = 一个 Agent
@@ -199,6 +199,8 @@ Claude Code = 一个 agent loop
199199
> **s18** &nbsp; *"各干各的目录, 互不干扰"* &mdash; 任务管目标, worktree 管目录, 按 ID 绑定
200200
>
201201
> **s19** &nbsp; *"能力不够? 插上 MCP"* &mdash; 多传输、通道路由、工具池合并
202+
>
203+
> **s20** &nbsp; *"机制很多,循环一个"* &mdash; 前面所有机制回到一个完整 harness
202204
203205
---
204206

@@ -253,8 +255,8 @@ pip install -r requirements.txt
253255
cp .env.example .env # 编辑 .env 填入你的 ANTHROPIC_API_KEY
254256

255257
python s01_agent_loop/code.py # 起点 — 一个循环 + bash
256-
python s08_context_compact/code.py # 上下文压缩(最复杂章
257-
python s_full/code.py # 总纲: 全部 19 个机制合一
258+
python s08_context_compact/code.py # 上下文压缩(复杂章
259+
python s20_comprehensive/code.py # 终点章: 全部机制归到一个循环
258260
```
259261

260262
### Web 平台
@@ -265,7 +267,7 @@ python s_full/code.py # 总纲: 全部 19 个机制合一
265267
cd web && npm install && npm run dev # http://localhost:3000
266268
```
267269

268-
## 五个阶段
270+
## 六个阶段
269271

270272
| 阶段 | 章节 | 你在构建什么 |
271273
|---|---|---|
@@ -274,6 +276,7 @@ cd web && npm install && npm run dev # http://localhost:3000
274276
| **知识与韧性** | `s09-s11` | memory → prompt assembly → error recovery |
275277
| **持久化工作** | `s12-s14` | task graph → background → cron |
276278
| **多 Agent 平台** | `s15-s19` | teams → protocols → autonomy → worktree → MCP |
279+
| **完整 Harness** | `s20` | 全部机制归到一个 agent loop |
277280

278281
## 全部章节
279282

@@ -298,6 +301,7 @@ cd web && npm install && npm run dev # http://localhost:3000
298301
| [s17](./s17_autonomous_agents/) | Autonomous Agents | 空闲循环 / 自动认领 |
299302
| [s18](./s18_worktree_isolation/) | Worktree Isolation | `WorktreeRecord` / 任务-目录绑定 |
300303
| [s19](./s19_mcp_plugin/) | MCP Plugin | 多传输 / 通道路由 / 工具池合并 |
304+
| [s20](./s20_comprehensive/) | Comprehensive Agent | 全部机制归到一个循环 |
301305
| [s_full](./s_full/) | 总纲 | s01-s19 全部机制合并 |
302306

303307
## 项目结构
@@ -313,16 +317,18 @@ learn-claude-code/
313317
s02_tool_use/
314318
...
315319
s19_mcp_plugin/
316-
s_full/ # 总纲
320+
s20_comprehensive/ # 终点章
321+
s_full/ # 旧总纲
317322
agents/ # 扁平副本,方便 python agents/sXX.py 快速运行
318323
skills/ # s07 使用的 skill 文件
319324
docs/ # 旧版线上文档(已归档)
320325
web/ # Web 教学平台
321326
tests/
327+
```
322328

323329
## 学完之后 -- 从理解到落地
324330

325-
19 个课程走完, 你已经从内到外理解了 harness 工程的运作原理。两种方式把知识变成产品:
331+
20 个课程走完, 你已经从内到外理解了 harness 工程的运作原理。两种方式把知识变成产品:
326332

327333
### Kode Agent CLI -- 开源 Coding Agent CLI
328334

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Every lesson layers one harness mechanism on top of this loop -- the loop itself
159159

160160
---
161161

162-
## 19 Progressive Lessons
162+
## 20 Progressive Lessons
163163

164164
**Each lesson adds one harness mechanism. Each mechanism has a motto.**
165165

@@ -200,10 +200,12 @@ Every lesson layers one harness mechanism on top of this loop -- the loop itself
200200
> **s18** &nbsp; *"Each works in its own directory, no interference"* &mdash; tasks own goals, worktrees own directories, bound by ID
201201
>
202202
> **s19** &nbsp; *"Not enough capability? Plug in more via MCP"* &mdash; multi-transport, channel routing, tool pool merging
203+
>
204+
> **s20** &nbsp; *"Many mechanisms, one loop"* &mdash; all previous mechanisms return to one complete harness
203205
204206
---
205207

206-
## Five Stages
208+
## Six Stages
207209

208210
| Stage | Chapters | What you are building |
209211
|---|---|---|
@@ -212,6 +214,7 @@ Every lesson layers one harness mechanism on top of this loop -- the loop itself
212214
| **Knowledge and resilience** | `s09-s11` | memory → prompt assembly → error recovery |
213215
| **Durable work** | `s12-s14` | task graph → background execution → scheduled triggers |
214216
| **Multi-agent platform** | `s15-s19` | teams → protocols → autonomy → worktree isolation → MCP |
217+
| **Complete harness** | `s20` | full agent loop with all mechanisms assembled |
215218

216219
---
217220

@@ -238,6 +241,7 @@ Every lesson layers one harness mechanism on top of this loop -- the loop itself
238241
| [s17](./s17_autonomous_agents/) | Autonomous Agents | idle cycle / auto-claim / self-organization |
239242
| [s18](./s18_worktree_isolation/) | Worktree Isolation | `WorktreeRecord` / task-directory binding |
240243
| [s19](./s19_mcp_plugin/) | MCP Plugin | multi-transport / channel routing / tool pool merge |
244+
| [s20](./s20_comprehensive/) | Comprehensive Agent | all mechanisms around one loop |
241245
| [s_full](./s_full/) | Capstone | all mechanisms from s01-s19 merged |
242246

243247
---
@@ -257,7 +261,7 @@ s08_context_compact/
257261

258262
Read the `README.md` for the core idea and work through the code. Complex chapters have `<details>` folds for deep dives -- open them when you want to go deeper. Simple chapters have 0-1 diagrams, complex chapters have more.
259263

260-
Read from s01 through s19 in order. Each chapter assumes you've read the previous ones and ends with a hook into the next.
264+
Read from s01 through s20 in order. Each chapter assumes you've read the previous ones and ends with a hook into the next.
261265

262266
---
263267

@@ -271,7 +275,7 @@ cp .env.example .env # configure ANTHROPIC_API_KEY
271275

272276
python s01_agent_loop/code.py # Start here -- one loop + bash
273277
python s08_context_compact/code.py # Context compaction (complex)
274-
python s_full/code.py # Capstone: all mechanisms
278+
python s20_comprehensive/code.py # Endpoint: all mechanisms in one loop
275279
```
276280

277281
---
@@ -289,7 +293,8 @@ learn-claude-code/
289293
s02_tool_use/
290294
...
291295
s19_mcp_plugin/
292-
s_full/ # capstone
296+
s20_comprehensive/ # endpoint chapter
297+
s_full/ # legacy capstone
293298
agents/ # flat copies for quick python agents/sXX.py
294299
skills/ # skill files used by s07
295300
docs/ # legacy online docs (archived)
@@ -301,7 +306,7 @@ learn-claude-code/
301306

302307
## What's Next
303308

304-
After 19 lessons, you understand harness engineering from the inside out. Two paths to turn that knowledge into product:
309+
After 20 lessons, you understand harness engineering from the inside out. Two paths to turn that knowledge into product:
305310

306311
### Kode Agent CLI -- Open-Source Coding Agent CLI
307312

0 commit comments

Comments
 (0)