insight Latent Space Wed, 21 Oct 2026 正文 ok 2092 words

Claude Mods:彻底反转 Agent Harness 的交互范式

英文标题:Claude Mods: Flipping the Harness Inside Out

Claude Mods 作为 Claude Code 的插件扩展机制,标志着“注意力接口”(Attention Interface)的早期落地。它将传统面向机器调用的 Agent Harness 范式彻底反转,使其转变为面向人类注意力的交互中间件,允许开发者通过 TypeScript/JavaScript 定制交互和执行流程。与 ChatGPT 的生成式 UI(Intelligent UI)以及 Cursor 的 PR 路由规则相比,Claude Mods 赋予了工程师深度可编程的控制权。尽管当前面临信息噪音、Token 成本以及缺乏沙箱隔离的安全隐患,但它指明了未来 Harness 进化为全新平台、并能自主感知人机摩擦而持续自进化的方向。
打开原文相关 3.3 · 机会 1
media1.5 KB media13.3 KB media1.3 KB media65.7 KB media167.3 KB media208.5 KB media384.4 KB media347.8 KB media98.7 KB media126.6 KB

中文

过去几周里,我一直在使用 Claude Mods 将 Claude Code 深度塑造成契合我个人 AI 工程工作流的形态。Claude Code 开箱即用已经很出色,但每个工程师的工作流各有不同。Claude Mods 能让你真正把 Claude Code 变成属于你自己的工具——以你期望的方式去分配注意力。

“如何分配注意力”,如今成了最关键的事情。

在最近发表于 Latent Space 的文章《The Evolution of the Agent Harness》中,我提出过一个观点:随着模型将越来越多的 Harness(脚手架/运行框架)逻辑吸收进权重本身,留下的部分将直接面向人类。 它演变成了注意力接口(Attention Interface):正是这一层决定了 Agent 何时打断你、向你展示什么,以及需要你做出哪些决策。Claude Mods 就是注意力接口的一种早期形态,而且是一个你可以亲手塑造的接口。

这是我的预判:Harness 最终会演变为其他公司在其上构建业务的平台,而模型则作为底层引擎。就像浏览器成为 Web 应用的平台一样,Harness 也会成为人与 Agent 之间交互界面的平台。

Mod 本质上是 Claude Code 的插件,由运行在 Claude Code 内部的 TypeScript 或 JavaScript 函数组成。这些函数在 CLI 和桌面客户端中自定义界面的行为与外观。Mods 响应各类事件,例如提示词输入、工具调用(tool call)或界面渲染。它们可以观测事件、修改其渲染方式,甚至替代默认行为直接接管处理。

Claude Mods 是 Agent Harness 的中间件。它们注入代码来改变 Claude Code 的执行与渲染流程,从而在运行时改变应用程序的行为。

Claude Mods 让人类与 Agent 能够共同构建 Harness 面向人类的那一部分。现在,你可以与 Claude 一同设计 Claude 与你的协同方式。这就是“注意力接口”的本质。

Agent Harness 最早起源于 Agent 与其运行机器之间的接口。它允许你向 Agent 发出提示词,然后 Agent 发送命令、编辑文件并调用工具。如今,它正逐渐演变为 Agent 与人类交互的方式。

Claude Mods 让你能够反转 Harness 的方向。 不再是从 Agent 指向机器,而是将其从 Agent 指向人类操作者,Harness 从而变成了一种与人类注意力交互的方式。

Claude Mods 让面向人类的那一层变得可编程——由使用 Claude 的人类亲自编写。

Claude 也能为你构建 Mod。 Claude Code 配备了一项内置技能(skill),教会它如何构建 Mod。因此,你只需用自然语言描述你想要的 Mod,Claude 就会为你构建出来。

Claude Code 自身的某些功能其实已经是 Mod 了。Anthropic 已经内置发布了其中 6 个。你可以通过运行 /plugin 并打开 Installed 查看,它们列在 Built-in 之下:

  • agents-md: 加载 AGENTS.md 作为项目全局指引。
  • diff: 接管 /diff 并绘制对应的面板。
  • plugin-authoring: 赋予 Claude 为你编写 Mod 所需的技能。
  • sec-default: 保护你的组织管理策略免受用户安装的 Mod 干扰。
  • telemetry: 发送 Claude Code 及其内置 Mod 记录的分析数据。
  • you-should-know: 一个旁路 Agent(side agent),在发现你可能忽略的内容时,会在输入提示框上方显示提示。它是唯一一个默认处于关闭状态的内置 Mod。

这些内置 Mod 大多在后台运行,这非常有意思,因为这意味着 Anthropic 本身就在将 Claude Code 的各个模块实现为 Mod——甚至包括那些你可能完全没察觉的部分。我自己手动开启的一个是 You Should Know。

以下是我在实际开发中发现最实用的两个 Mod:一个是官方内置的,另一个是我自己构建的。

内置 Mod:You Should Know

这是 Anthropic 构建的原生 Claude Code 插件。它运行一个旁路 Agent,在主 Agent 工作时对其进行观察,并标记出你很可能会忽略的重要信息。可以将其理解为:某些工具调用和决策会对最终输出产生实质性影响,但因为深埋在 Agent 执行轨迹(trace)中而不容易被察觉。它内置于 Claude Code 中,但默认关闭,直到你手动开启它。

这里有一个真实案例:我让 Claude Code 帮我精简一个个人项目中杂乱的 UI 文案。主 Agent 修剪了“Compare”界面的文案,安装了新构建并截取了修改前后的对比截图。一切看起来都已大功告成。

这时,You Should Know 为我标记了一项情况。Agent 正在编辑的文件 CompareView.swift 中原本就存在尚未提交的代码——另外还有大约 45 个文件也是如此。如果我随后放弃这次演示性的修改,我也会一并丢弃之前未完成的那些工作。它给出的建议是:先提交或 stash 之前的工作。

在这个案例中,You Should Know 避免了我无意中丢弃代码资产。

自建 Mod:Next Steps Supervisor

这个 Mod 仅在编辑了文件、运行了命令或进行了 8 次及以上工具调用的一轮交互(turn)之后运行。在下方的界面中,你将看到标记出来供你注意的 6 条不同信息。随后,Next Steps Supervisor 会建议下一步操作,并以可点击按钮的形式呈现,点击即可将该指令作为消息发送给 Claude Code。该 Mod 作为 ModSmith 的一部分开源提供——这是我构建的一个开源 Claude Code 插件,包含数个不同的内置 Mod,以及供 Claude 构建能够协同工作的新 Mod 的模板。

三种范式:ChatGPT、Cursor 与 Claude Mods

Anthropic 并不是唯一一家在探索注意力接口的公司。最近来自 OpenAI 和 Cursor 的两款产品也指向了同一个方向。以新的 ChatGPT Intelligent UI 和 Cursor 的 PR 路由与批准(PR Routing & Approval) 作为参考坐标,更能突显 Claude Mods 的独特之处。

10 月 7 日,OpenAI 在 ChatGPT 内上线了 GPT-6,并推出了名为 Intelligent UI 的全新 ChatGPT 界面。ChatGPT 不再仅仅以文本形式回答,而是可以在回答时动态生成交互界面:图表、地图、检查清单、表单以及 AA 制分账器或储蓄计算器等小工具。这一切都是模型作为一种**生成式 UI(generative UI)**即时生成的。

在 OpenAI 展示的一个示例中,ChatGPT 会返回多选题形式的跟进问题,以逐步缩小搜索范围。可以这样理解:模型自行决定何时需要你的判断,然后构建相应的交互界面供你操作。

这就是一种注意力接口。Agent 主导设计了你与其回答的交互方式。

但注意 ChatGPT 的 Intelligent UI 与 Claude Mods 之间的差异:对于 Intelligent UI,模型是在 OpenAI 预设的组件库中逐个回答挑选界面。上线时唯一提到的控制选项是调低视觉效果。

Cursor 则从另一端切入同一问题:面向的不是一个人与一次回答,而是一个团队和源源不断由 Agent 编写的 Pull Request(PR)流。必须有人来决定哪些变更值得引起人类(human-in-the-loop)的注意。

PR Routing & Approval 负责做出这一决策。它根据代码所有权和提交历史分配审查人员,并能自动批准低风险 PR。它会结合你设定的阈值风险评分、Cursor Bugbot 和 Security 审查器的发现,以及仓库中的 policy 文件进行权衡。

调研期间有一条规则引起了我的注意:如果某个 PR 修改了审批策略本身,Agent 不会使用修改后的版本来放宽对该 PR 的审查。它会从 base 分支读取策略。这意味着 Agent 无法通过篡改规则来让自己提交的 PR 蒙混过关。

Cursor 对其局限性也十分坦诚。其官方文档明确表示,该功能“不能替代完整的代码审查”。其核心在于将人类审查精力投入到关键环节,而不是完全消除人工审查。

这三套系统都在塑造究竟什么内容以何种方式获取你的注意力。 其核心区别在于:究竟由谁来设计注意力接口。

  • ChatGPT Intelligent UI: _模型_在平台搭建好的框架内为每个回答设计界面。零配置门槛,但掌控度极低。(我认为其目标用户不是工程师。)
  • Cursor PR Routing & Approval: _团队_编写策略,由固定的审查工作流执行。具备可配置性,但交互流由 Cursor 决定。你决定规则,但无法决定交互界面。
  • Claude Mods: 你和 Agent 用代码共同构建界面本身。Mod 可以挂钩到交互循环的任何节点——从你提交的提示词、Agent 发起的工具调用,到每一轮结束的瞬间——并决定在该处向你展示什么,以及你可以采取什么行动。

我前面提到的 Supervisor 就是一个典型例子。Cursor 固然可以根据触及的文件轻松将 PR 分配给我;ChatGPT 也能轻松把结论渲染成一张精美卡片。但它们都无法让我实现这样的定制:每一轮编辑文件的操作都要获得第二意见、该意见必须列出偷懒走捷径的地方,并且每一个建议的下一步只需按一下按键即可执行。这个界面之所以存在,是因为我偏好以这种方式投入注意力,并且是我与 Claude 共同构建了它。

ChatGPT 和 Cursor 提供的是由别人设计好的注意力接口。Claude Mods 允许你与 Claude 共同设计自己的专属接口,但其代价在于:你必须对它的实用性负责。

现实代价与权衡

Mod 并非没有代价,我在实践中也遇到了一些弊端。

首先是噪音。 Next Steps Supervisor 在任何修改文件、执行命令或发起 8 次以上工具调用的轮次后都会运行。在实践中,几乎每一轮都会触发。 自从我 10 月 15 日安装以来,我在 Claude Code 中的 111 个轮次中有 99 个都触发了这一条件。有些判断确实很有帮助,其余的则纯粹是干扰噪音。当一个 Mod 几乎在每个轮次都跳出来说话时,我便开始习惯性地扫一眼就略过——这恰恰违背了注意力接口的初衷。

其次是成本。 Supervisor 的每次检查都会派生(fork)对话并重新阅读上下文。其中大部分可以通过 prompt 缓存(prompt cache)命中,但该 Mod 自身的 README 预估,在一个包含 5 万 token 的会话中,单次检查大约消耗相当于 5,000 到 6,000 的输入 token,一旦缓存失效成本更高。

第三是信任与安全。 Mod 是以你的系统权限运行的代码。Anthropic 的文档对此说得很清楚:Mod 一旦加载,就可以读写你的文件、查看你发送的每条提示词,并消耗你的调用额度。此外,“Mod 并没有沙箱隔离(mods aren’t sandboxed)。” 即使你使用 --safe-mode 启动 Claude Code,内置 Mod 仍会继续运行。对于我自己编写或随 Claude Code 官方内置的 Mod 我可以放心使用,但若要安装其他人编写的代码,我一定会先逐行审查。

好的一面在于,Mod 具备其他工具所没有的可修复性。 当 Supervisor 在某一会话中产生噪音时,运行 /supervisor off 即可将其关闭。因为这是我自己的 Mod,我随时可以修改它的运行触发时机。

定制 Harness 并不保证对每位工程师都是纯收益。我添加的每一个 Mod,都是我需要额外付出注意力的信息载体。 在我的一次会话中,我的 Next Steps Supervisor 将某项任务标记为“已解决”,但同时也列出了 2 个缺口和 3 个捷径。Agent 是聪明的但远非完美,而我个人的注意力也同样远非完美。

因此,我用来衡量 Mod 实用性的标准非常简单:它是否揭示了我原本会遗漏的内容?是否简化了决策?或者是否让我能够迅速采取行动而不被更多输出分散注意力?如果做不到,它就只是华而不实的表面功夫,称不上是实用工具。

下一步:自我演进的 Harness

目前,构建 Mod 的流程是这样的:我察觉到与 Claude 协同中的摩擦,描述我想要的 Mod,然后 Claude 与我一起完成构建。这仍然需要我个人的注意力来主动捕捉摩擦。

下一步则是让 Harness 自行察觉摩擦。 Claude Code 本就已经保存了我的会话转录记录。可以设想:后台运行一个进程来分析这些记录,找出我反复纠正 Agent 或重复手工验证同一类问题的地方,并据此主动建议一个 Mod。随后它帮助我测试该 Mod,并根据我的反馈进行迭代。

这才是 AI 工程师的终极形态:一个具备延展性、能根据真实生产环境使用经验主动提议自我进化的 Harness。 Claude Mods 正是迈向该方向的一步。

如果我开头的预判正确,几年后我们将开始讨论基于 Claude Code、Codex,或某种尚未面世的 Harness 之上诞生的初创公司。

最后留给大家一个问题,希望答案能为你带来实际价值:在使用 Claude Code 的过程中,你注意到了哪些阻碍摩擦,是今天读完这篇文章后能启发你通过编写 Mod 来化解的?

English / 原文

For the last few weeks I’ve used Claude Mods to mold Claude Code to my AI engineering workflow. Claude Code is great out of the box, but every engineering workflow is different. Claude Mods let you make Claude Code yours, in the way you want to pay attention.

The “paying attention” part is now the most important thing.

In a recent Latent Space post, The Evolution of the Agent Harness, I argued that as models absorb more of the harness into their weights, the part that’s left faces the human. It becomes the Attention Interface : the layer that decides when the agent interrupts you, what it shows you, and which decisions it needs you to make. Claude Mods are an early version of the Attention Interface, and one you can shape yourself.

Here’s my bet: ultimately, the harness becomes a platform that other companies build on , with models as the engine. Just as the browser became a platform for web apps, the harness could become a platform for the interfaces between people and agents.

A mod is a Claude Code plugin that consists of TypeScript or JavaScript functions that run inside Claude Code. These functions customize the behavior and appearance of the interface in the CLI and Desktop. Mods respond to events , like a prompt, tool call or interface render. They can observe the event, modify how it’s rendered, and handle it in place of the default behavior.

Claude Mods are middleware for the agent harness. They inject code that changes Claude Code’s execution and rendering flow, changing how the application behaves at runtime.

Claude Mods let the human and the agent build the human-facing part of the harness together. You can now work with Claude to design how Claude works with you. That is the essence of the “Attention Interface.”

The agent harness started as an interface between the agent and the machine it runs on. It lets you prompt the agent and the agent then sends commands, edits files and calls tools. Now it’s gradually becoming a way for the agent to interface with the human.

Claude Mods let you reverse the direction of the harness. Rather than the harness pointing from the agent to the machine, you point it from the agent to the human operator, and the harness becomes a way to interface with human attention.

Claude Mods make the human layer programmable, by the human who uses Claude.

Claude can also build mods for you. Claude Code has a built-in skill that teaches it how to build mods, so you can ask for the mod you want in plain language and Claude will build it.

Some of Claude Code’s own features are already mods. Anthropic has shipped six of them built-in. You can see these by running /plugin and opening Installed , where they’re listed under Built-in:

  • agents-md: loads AGENTS.md as project instructions.

  • diff: takes over /diff and draws its pane.

  • plugin-authoring: gives Claude the skill it uses to write mods for you.

  • sec-default: guards what your organization manages from the mods a user installs.

  • telemetry: sends the analytics records that Claude Code and its built-in mods log.

  • you-should-know: a side agent that shows a note above the prompt when it finds something you might have missed. It’s the only one that’s off by default.

Most of these work in the background, which is interesting because it means Anthropic is building parts of Claude Code as mods — even parts you may not notice. The one I’ve turned on myself is You Should Know.

Here are the two mods I’ve found most useful in practice: one a built-in, and one I built myself.

This is a native Claude Code plugin built by Anthropic. It runs a side-agent that observes the main agent while it works and flags important information you’re likely to miss. Think about it like: tool calls and decisions that have a material impact on the output, but aren’t necessarily easily visible because they’re buried in the agent trace. It comes built into Claude Code, but it’s off until you turn it on.

Here’s a real example. I asked Claude Code to simplify the noisy UI text in one of my personal projects. The main agent trimmed the copy on the Compare screen, installed the new build and took before-and-after screenshots. Everything looked done.

Then You Should Know flagged something for me. CompareView.swift, the file the agent was editing, already had uncommitted work in it — and so did about 45 other files. If I later discarded the demo edits, I’d throw away that earlier unfinished work too. Its suggestion was to commit or stash the earlier work first.

In this case, the You Should Know mod saved me from discarding work unintentionally.

This mod only runs after a turn that edited files, ran commands or made 8 or more tool calls. In the screenshot below, you’ll see six different pieces of information flagged for your attention. Next Steps Supervisor then suggests a next step to take, as a clickable button which sends the instruction as a message to Claude Code. This mod is available as part of **ModSmith **— an open-source Claude Code plugin I built with several different built-in mods, as well as a template Claude can use to build new mods that work together.

Anthropic isn’t the only company that’s building an Attention Interface. Two recent products, one from OpenAI and one from Cursor, point in the same direction. Using the new ChatGPT Intelligent UI and Cursor’s PR Routing & Approval as a frame of reference shows what’s unique about Claude Mods.

On October 7, OpenAI shipped GPT-6 inside ChatGPT alongside a new ChatGPT interface it calls Intelligent UI. Rather than answering only in text, ChatGPT now can generate an interface as it answers : charts, maps, checklists, forms, and small tools like a bill splitter or a savings calculator. All generated on the fly by the model as a type of generative UI.

In one of OpenAI’s examples, ChatGPT replies with multiple-choice follow-up questions to narrow down what you’re looking for. Think about it like: the model decides when it needs your judgment, then builds the interface for you to give it.

That’s an Attention Interface. The agent designs how you interact with its response.

But notice the difference between ChatGPT’s Intelligent UI and Claude Mods. For Intelligent UI, the model picks the interface, answer by answer, from a component library that OpenAI built. The one control mentioned at launch is turning the visuals down.

Cursor is working on the same problem from the other end: not one person and one answer, but a team and a stream of pull requests , more and more of them written by agents. Someone has to decide which changes deserve the attention of the human-in-the-loop.

PR Routing & Approval makes that decision. It assigns reviewers based on code ownership and commit history, and it can auto-approve low-risk PRs. It weighs a risk score against a threshold you set, findings from Cursor’s Bugbot and Security reviewers, and policy files that live in the repo.

One rule caught my attention during research. If a PR edits an approval policy, the agent won’t use the edited version to relax review on that same PR. It reads the policy from the base branch instead. That means an agent can’t change the rules to get its own PR approved.

Cursor is also clear about the limits. Its docs say the feature “does not replace a full code review.” The point is to spend human review where it matters, not to remove it.

All three systems shape what gets your attention and how. The main difference is who gets to design the Attention Interface.

  • ChatGPT Intelligent UI: the model designs the interface for each answer, inside a frame the lab built. Zero setup, but little control. (I don’t believe the target user is engineers.)

  • Cursor PR Routing & Approval: the team writes policy, and a fixed review workflow enforces it. Configurable, but the flow of the interaction is Cursor’s. You decide the rules, not the interface.

  • Claude Mods: you and the agent build the interface itself, in code. A mod can hook into any point in the loop — from the prompt you submit to the tool call the agent makes to the moment a turn ends — and decide what to show you there and what you can do about it.

The supervisor I showed earlier is a good example. Cursor could easily route a PR to me because of the files it touched. ChatGPT could just as easily render the verdict as a nice card. But neither would let me decide that every turn which edits a file gets a second opinion, that the opinion lists shortcuts taken, and that each suggested next step is one keypress away. That interface exists because I prefer to pay attention that way, and Claude built it with me.

ChatGPT and Cursor give you an Attention Interface that someone else designed. Claude Mods let you design your own with Claude, but the tradeoff is you’re responsible for making it useful.

Mods aren’t free, and I’ve run into some downsides.

The first is noise. Next Steps Supervisor runs after any turn that edits a file, runs a command or makes 8 or more tool calls. In practice, that’s nearly every turn. Since I installed it on October 15, 99 of my 111 turns in Claude Code met that bar. Some of those verdicts are useful, others are just noise. So when a mod speaks up on almost every turn, I start skimming past it — which defeats the point of an Attention Interface.

The second is cost. Each supervisor check forks the conversation and re-reads it. Most of that is served from the prompt cache, but the mod’s own README estimates about 5–6k input-equivalent tokens per check on a 50k-token session, and more when the cache has expired.

The third is trust. A mod is code that runs with your permissions. Anthropic’s docs are clear about this: once it loads, a mod can read and write your files, see every prompt you send, and spend your usage. Plus, “mods aren’t sandboxed.” Built-in mods also keep running when you start Claude Code with --safe-mode. I’m comfortable with mods I wrote or that ship with Claude Code, but I’d read anyone else’s code before installing it.

The upside is that mods are fixable in a way other tools aren’t. When the supervisor is noise for a session, /supervisor off turns it off. Because it’s my mod, I can change when it runs.

Customizing the harness isn’t guaranteed to be a win for every individual engineer. Every mod I add is another piece of information I need to give my attention to. In one of my own sessions, my Next Steps Supervisor marked a task as “Solved” yet also listed two gaps and three shortcuts. Agents are intelligent but far from perfect, and my attention is far from perfect too.

So the test I use to gauge the usefulness of my mods is simple: did it surface something I would have missed, make a decision easier, or let me act without getting distracted by more output? If not, it’s just window-dressing rather than a useful tool.

Right now, building a mod works like this: I notice friction in how I work with Claude, describe the mod I want, and Claude builds it with me. My personal attention is still needed to notice the friction.

The next step is for the harness to notice the friction. Claude Code already keeps my session transcripts. Think about it like: a background process reads through them, finds the places where I keep correcting the agent or checking the same thing by hand, and suggests a mod for it. Then it helps me test that mod and refines it from my feedback.

That’s the best case for AI engineers: a malleable harness that suggests ways to improve itself from real-world use. Claude Mods are a step in that direction.

If the bet I made at the start is right, in a few years we will talk about the startups that were built on Claude Code, or Codex, or a harness that doesn’t exist yet.

I’ll leave you with a question, where the answer hopefully provides you with practical value: what friction have you noticed working with Claude Code that this article can inspire you to solve with a mod today?