来自 Claude Code 的 12 个 Agentic Harness Patterns
The leaked source revealed how a production coding agent is actually assembled. Here are the design patterns behind it.
泄露的源代码揭示了生产编码代理是如何实际组装的。这里是其背后的设计模式。
There are many things to learn from the Claude Code leak, and I covered a few in my previous post. But formulating learnings as patterns is my passion. I loved doing it with Kubernetes Patterns, now exploring it with Prompt Patterns, and when I looked at the leaked harness, I could not help seeing patterns there too. Here I am framing them as reusable design patterns for anyone building agentic applications.
从 Claude Code leak 中有许多东西可以学习,我在上一篇文章中涵盖了一些。但是将学习制定为模式是我的热情。我喜欢用Kubernetes Patterns做这个,现在用Prompt Patterns探索它,当我查看泄露的 harness 时,我不禁看到了那里的模式。这里我将它们框架化为构建代理式应用的任何人的可重用设计模式。

Overview diagram showing 12 agentic harness patterns organized in four categories: Memory & Context, Workflow & Orchestration, Tools & Permissions, and Automation.
概述图显示了按四个类别组织的 12 种 agentic harness 模式:Memory & Context、Workflow & Orchestration、Tools & Permissions 和 Automation。
The patterns fall into four categories: memory and context, workflow and orchestration, tools and permissions, and automation.
这些模式分为四个类别:memory and context、工作流与编排、tools and permissions,以及 automation。
Memory and Context
内存与上下文
These five patterns form a progression: from giving the agent a static file of rules, to scoping those rules by directory, to organizing memory into tiers, to cleaning that memory in the background, to compressing the conversation itself when the context window fills up.
这五个模式形成一个渐进序列:从给代理一个静态规则文件,到按目录范围限定这些规则,到将内存组织成层级,到在后台清理该内存,到当上下文窗口填满时压缩对话本身。
1. Persistent Instruction File Pattern
1. Persistent Instruction File Pattern
Without a persistent instruction file, every agent session starts blank. The user repeats the same conventions, commands, and boundaries each time. The agent makes the same mistakes in session five that it made in session one.
没有持久的指令文件,每个代理会话都从空白开始。用户每次都要重复相同的约定、命令和边界。代理在第五个会话中会犯下与第一个会话相同的错误。
This pattern introduces a durable project-level configuration file loaded automatica...