返回列表
🧠 阿头学 · 🪞 Uota学

Claude 5 上下文工程范式转移:从微观规则到渐进式披露

Anthropic 宣称新模型已具备自主判断力,通过删减 80% 提示词并转向“渐进式披露”能显著提升效率,但这本质上是将自然语言门槛转嫁为复杂的系统架构成本。
打开原文 ↗

2026-07-28 原文链接 ↗
阅读简报
双语对照
完整翻译
原文
讨论归档

核心观点

  • 规则让位判断:新一代模型能力越过阈值,过度约束的防御性提示词反而制造指令冲突,必须从“给死规则”转向“让模型匹配环境”。
  • 接口优于示例:提供具体示例会限制模型的探索空间,设计清晰的工具接口(如参数枚举)比长篇大论的说明书更有效。
  • 渐进式披露架构:上下文不再是静态文档,而是动态索引,通过延迟加载和按需检索(如独立Skill文件)解决长上下文注意力稀释问题。
  • 品味可执行化:通过提供高保真参考资料(代码、HTML)和评分标准(Rubrics),将主观的专家品味转化为可运行的验证工作流。

跟我们的关联

  • 对 ATou 意味着什么:提示词工程正在从“写小作文”演变为“系统架构设计”,下一步应停止堆砌否定指令,转而构建按需加载的工具链。
  • 对 Uota 意味着什么:管理 AI 就像管理高阶员工,下一步需放弃微观管理(给SOP),转向目标管理与资源赋能(给接口和Rubrics)。

讨论引子

  • 在金融或医疗等高风险场景中,放弃显式规则而依赖模型的“自主判断”,是否会带来不可控的合规灾难?
  • “渐进式披露”是否只是大厂为了推销复杂 Agent 架构和付费功能(如 Claude Code)而制造的伪需求?

我们为最新模型移除了约 80% 的 Claude Code 系统提示词,以下是我们关于编写系统提示词、技能(Skills)以及 CLAUDE.md 文件的经验总结。http://x.com/i/article/2080703729385512960

我之前写过关于如何最好地为最新一代 Claude 5 模型编写提示词,并通过迭代与它们合作来探索你想要构建的内容。

但是,当你向 Claude 发送消息时,提示词只是它获取的上下文的一小部分。你的大部分上下文是由系统提示词、技能(Skills)、CLAUDE.md 文件、记忆(Memory)和其他来源组合而成的。我们称之为上下文工程(Context Engineering),它对你使用 Claude Code 或构建自己的智能体(Agents)时生成的结果有重大影响。

与提示词不同,上下文通常在许多请求中通用,因此它不能那么具体。你如何为 Claude 构建这些通用的提示词和指导,特别是当你不知道用户的提示词可能是什么时?

随着 Claude 自身能力的演进,这可能会变得出奇地困难。最近,我们注意到在为最新一代 Claude 模型编写提示词的方式上出现了巨大的飞跃。我们为 Claude Opus 5 和 Claude Fable 5 等模型移除了超过 80% 的 Claude Code 系统提示词,而在我们的编码评估中没有出现可衡量的损失。

以下是我们关于为这类新模型编写提示词的经验,以及你如何利用它来更新你的上下文工程(Context Engineering)。我们将这些最佳实践放入了 claude doctor 中,在 Claude Code 中使用 /doctor 命令来优化你的技能(Skills)和 CLAUDE.md 文件。

解除 Claude 的束缚

总的来说,我们发现我们对 Claude Code 的约束过度了,无论是在系统提示词中,还是在我们的 CLAUDE.md 文件和技能(Skills)中。

例如,当我们阅读内部使用 Claude Code 的记录时,我们会在单个请求中看到几个相互冲突的消息,比如“酌情留下文档”或“不要添加注释”,因为我们的系统提示词、技能(Skills)和用户请求相互冲突。

https://claude.com/blog/a-field-guide-to-claude-fable-finding-your-unknowns

通常,Claude 可以理解用户的意图以得出正确的答案,但在决定做什么之前,Claude 必须更仔细地思考这些重叠和冲突的消息。

虽然这些约束曾经是避免最坏情况所必需的,但我们后来发现我们可以删除其中许多约束,让模型使用周围的上下文和判断力。

此外,Claude Code 现在拥有更多的工具。Claude 过去依赖 CLAUDE.md 作为记忆、信息和指导的来源。现在我们有了记忆(Memory)、工件(Artifacts)和技能(Skills),Claude 可以使用它们来创建在会话之间加载和共享上下文的新方法。

过去与现在

以前有许多上下文工程(Context Engineering)的最佳实践已经变成了误区。包括:

https://claude.com/blog/a-harness-for-every-task-dynamic-workflows-in-claude-code

** 过去:给 Claude 制定规则 现在:让 Claude 自行判断 **当我们首次推出 Claude Code 时,我们需要确保 Claude 避免最坏的情况,例如删除文件。这意味着我们会提供特别强烈的指导,而这些指导可能并不总是正确的。例如,在系统提示词中我们过去常说:

在代码中:默认不写注释。永远不要写多段落的文档字符串或多行注释块——最多一行短注释。除非用户要求,否则不要创建计划、决策或分析文档——从对话上下文中工作,而不是中间文件。

但对于某些特定的提示词,这种指导是错误的。在文档的情况下,用户可能有自己的偏好,或者非常复杂的代码的特定部分可能需要多行注释块。

尽管如此,如果没有这些针对旧模型的护栏,Claude 编写的注释在许多情况下会是不正确的,我们不得不接受这种权衡。但较新的模型具有更好的判断力,可以在没有明确规则的情况下很好地处理这些决策。

在新的系统提示词中我们说:编写读起来像周围代码的代码:匹配其注释密度、命名和习惯用法。

过去:给 Claude 提供示例 现在:设计接口 工具使用的第一条规则是给 Claude 提供如何使用它们的示例。对于我们最新的模型,我们发现提供示例实际上将它们限制在特定的探索空间中。

http://claude.md/

与其使用示例,不如多思考你的工具、脚本和文件的设计——Claude 有哪些参数,它们如何更具表现力?

例如,在 Todo 工具示例中,只需将状态列为 pending、in_progress 和 completed 之间的枚举,就能向 Claude 提示如何使用它。关于保持一个项目为 in_progress 的指令有助于定义我们请求的行为。

过去:把所有东西放在前面 现在:使用渐进式披露

因为 Claude Code 专注于编码,我们的系统提示词包含了关于如何进行代码审查和验证的详细信息。这些并不总是需要的,但当需要时,它是至关重要的信息。

从那时起,Claude Code 在使用渐进式披露(Progressive Disclosure)方面变得非常能干——在正确的时间加载正确的上下文。例如,我们将验证和代码审查移到了它们自己的技能(Skills)中,Claude Code 可以选择性地调用它们。

但渐进式披露(Progressive Disclosure)不仅适用于技能(Skills),我们也将其用于工具。我们的一些工具是“延迟加载”的,这意味着智能体(Agent)在使用它们之前必须使用 ToolSearch 搜索它们的完整定义。这允许我们拥有更多的工具(例如我们的 Task 工具),这些工具在需要之前不会占用上下文。

这同样适用于你自己的 CLAUDE.md 和 Skill.md 文件。一个常见的误区是,你想让这些文件成为你可能遇到的每个已知实践的中央存储库,因为否则 Claude 就找不到它。相反,考虑拥有一个可以在正确时间加载的文件树。

过去:重复你自己 现在:简单的工具描述

早期的 Claude 模型有时可能需要重复的指令,或者更有可能听从上下文窗口末尾的指令,而不是开头的指令。这意味着我们的系统提示词有时会在主系统提示词中引用工具,并在工具描述中包含指令。

我们发现我们可以删除这些重复的示例,并将如何使用工具的指令放在工具描述中,而不是系统提示词中。

过去:在 CLAUDE.md 文件中记录记忆 现在:自动记忆

我们过去鼓励用户通过使用 # 快捷键自动写入他们的 CLAUDE.md 来将内容保存到 Claude 的记忆中。相反,Claude 现在会自动保存与工作和你相关的记忆。

过去:简单的规范 现在:丰富的参考资料

在计划模式下,Claude Code 严重依赖带有计划的 Markdown 文件。将这些文件存储为计划有助于 Claude 在需要时参考它们。另一个类似的最佳实践是将规范存储在代码库中,以便 Claude 在处理较长项目时参考。

但我们发现 Claude 可以处理越来越复杂的参考资料。Claude 可以参考由我们新的工件(Artifacts)功能创建的 HTML 工件,而不是简单的 Markdown 文件。

你也可以以代码的形式给 Claude 提供参考资料。规范也可以是详细的测试套件,或者是 Claude 可能移植的不同代码库中的函数。

评分标准(Rubrics)是另一种形式的参考资料。评分标准(Rubrics)允许 Claude 尝试通过使用动态工作流并使用这些评分标准启动验证器智能体(Verifier Agents)来验证你在特定领域的品味(例如,好的 API 设计是什么样的)。

将此应用于你的上下文

将所有这些结合起来,当你组装你的上下文时,这看起来像什么?

https://claude.com/blog/a-harness-for-every-task-dynamic-workflows-in-claude-code

系统提示词 系统提示词与产品上下文紧密相连。它告诉 Claude 它在什么产品中运行以及它在做什么。对于 Claude Code,你可能永远不会修改它,但如果你正在构建自己的智能体工具(Agent Harness),这是你应该花大量时间的地方。

CLAUDE.md 保持你的 CLAUDE.md 轻量级,并简要描述你的代码库的用途,但将大部分 Token 花在代码库内部的陷阱上。例如,你可能会组织你的代码,将类型保存在一个单一的文件中,而不在其他任何地方。避免陈述 Claude 通过查看你的文件系统或代码库应该知道的“显而易见”的事情。

使用渐进式披露(Progressive Disclosure)获取更多细节,例如,如果你有几个关于如何验证工作的独特指令,创建一个验证技能(Skill)并从你的 CLAUDE.md 中引用它。

技能(Skills) 将技能(Skills)视为轻量级指南,让 Claude 在需要时找到信息。避免使它们过度受限,除非在非常重要的领域。

对于较长的技能(Skills),尽量多使用渐进式披露(Progressive Disclosure)——将其分成许多文件并拆分它们。

当技能(Skills)编码了特定于你、你的团队或产品的特定观点、知识或最佳实践时,效果最好。

参考资料 你可以 @ 提及文件以将它们作为参考资料包含在内。参考资料允许 Claude 参考有关当前计划的深入信息。

这可能在规范文件、模型或甚至整个代码库中。通常你应该更喜欢代码中的文件,因为它用 Claude 非常了解的语言为 Claude 提供了清晰、高保真的指令。例如,设计的 HTML 模型通常会比设计的描述或屏幕截图产生更好的结果。

尝试简化

在你的系统提示词、技能(Skills)和 CLAUDE.md 文件中,你可能需要像我们一样进行简化。我们推出了一个名为 claude doctor 的新命令,它也将帮助你自动执行此操作。有关专门为更高级模型编写提示词的更多详细信息,请查看我们的 Fable 现场指南。

We removed ~80% of the Claude Code system prompt for our newest models, this is what we've learned about writing system prompts, skills and Claude.MDs for them. http://x.com/i/article/2080703729385512960

我们为最新模型移除了约 80% 的 Claude Code 系统提示词,以下是我们关于编写系统提示词、技能(Skills)以及 CLAUDE.md 文件的经验总结。http://x.com/i/article/2080703729385512960

I’ve written previously about how to best prompt the newest generation of Claude 5 models and work with them iteratively to discover what you want to build.

我之前写过关于如何最好地为最新一代 Claude 5 模型编写提示词,并通过迭代与它们合作来探索你想要构建的内容。

But when you send a message to Claude, the prompt is only a small part of the context it gets. Much of your context is assembled from your system prompt, Skills, CLAUDE.md files, memory, and other sources. We call this context engineering, and it makes a big impact on the results you generate when using Claude Code or in building your own agents.

但是,当你向 Claude 发送消息时,提示词只是它获取的上下文的一小部分。你的大部分上下文是由系统提示词、技能(Skills)、CLAUDE.md 文件、记忆(Memory)和其他来源组合而成的。我们称之为上下文工程(Context Engineering),它对你使用 Claude Code 或构建自己的智能体(Agents)时生成的结果有重大影响。

Unlike a prompt, context is used generally across many requests, so it cannot be as specific. How do you build these general prompts and guidance for Claude, especially when you don’t know what a user’s prompt might be?

与提示词不同,上下文通常在许多请求中通用,因此它不能那么具体。你如何为 Claude 构建这些通用的提示词和指导,特别是当你不知道用户的提示词可能是什么时?

This can be surprisingly difficult as Claude’s own capabilities evolve. Most recently, we noticed a large jump in the way we prompt the newest generation of Claude models. We removed over 80% of Claude Code’s system prompt for models like Claude Opus 5 and Claude Fable 5 with no measurable loss on our coding evaluations.

随着 Claude 自身能力的演进,这可能会变得出奇地困难。最近,我们注意到在为最新一代 Claude 模型编写提示词的方式上出现了巨大的飞跃。我们为 Claude Opus 5 和 Claude Fable 5 等模型移除了超过 80% 的 Claude Code 系统提示词,而在我们的编码评估中没有出现可衡量的损失。

Here’s what we’ve learned about prompting this new class of models, and how you can utilize it to update your context engineering. We’ve put these best practices in claude doctor, use the command /doctor in Claude Code to rightsize your skills, and CLAUDE.md files.

以下是我们关于为这类新模型编写提示词的经验,以及你如何利用它来更新你的上下文工程(Context Engineering)。我们将这些最佳实践放入了 claude doctor 中,在 Claude Code 中使用 /doctor 命令来优化你的技能(Skills)和 CLAUDE.md 文件。

Unhobbling Claude

解除 Claude 的束缚

Overall, we found that we were over-constraining Claude Code, both through our system prompt and in our CLAUDE.md files and skills.

总的来说,我们发现我们对 Claude Code 的约束过度了,无论是在系统提示词中,还是在我们的 CLAUDE.md 文件和技能(Skills)中。

For example, when we read transcripts of our own internal usage of Claude Code, we see several conflicting messages in a single request like “leave documentation as appropriate,” or “DO NOT add comments” as our system prompt, skills, and user requests clash with each other.

例如,当我们阅读内部使用 Claude Code 的记录时,我们会在单个请求中看到几个相互冲突的消息,比如“酌情留下文档”或“不要添加注释”,因为我们的系统提示词、技能(Skills)和用户请求相互冲突。

Generally, Claude can interpret the user’s intent to get to the right answer, but Claude must think more carefully about these overlapping and conflicting messages before deciding what to do.

通常,Claude 可以理解用户的意图以得出正确的答案,但在决定做什么之前,Claude 必须更仔细地思考这些重叠和冲突的消息。

And while these constraints were once needed to avoid worst case scenarios, we have since found we can delete many of them and let the model use surrounding context and judgement instead.

虽然这些约束曾经是避免最坏情况所必需的,但我们后来发现我们可以删除其中许多约束,让模型使用周围的上下文和判断力。

Additionally, Claude Code now has many more tools. Claude used to rely on CLAUDE.md as a source of memory, information, and guidance. Now we have memory, artifacts, and skills, which Claude can use to create new ways of loading and sharing context across sessions.

此外,Claude Code 现在拥有更多的工具。Claude 过去依赖 CLAUDE.md 作为记忆、信息和指导的来源。现在我们有了记忆(Memory)、工件(Artifacts)和技能(Skills),Claude 可以使用它们来创建在会话之间加载和共享上下文的新方法。

Then and now

过去与现在

There were a number of previous context engineering best practices that had become myths. Including:

以前有许多上下文工程(Context Engineering)的最佳实践已经变成了误区。包括:

** Then: Give Claude rules Now: Let Claude use judgement **When we first rolled out Claude Code, we needed to be sure that Claude avoided worst case scenarios, such as deleting files. This meant we would give particularly strong guidance that might not always be true, For example, in the system prompt we used to say:

** 过去:给 Claude 制定规则 现在:让 Claude 自行判断 **当我们首次推出 Claude Code 时,我们需要确保 Claude 避免最坏的情况,例如删除文件。这意味着我们会提供特别强烈的指导,而这些指导可能并不总是正确的。例如,在系统提示词中我们过去常说:

In code: default to writing no comments. Never write multi-paragraph docstrings or multi-line comment blocks — one short line max. Don't create planning, decision, or analysis documents unless the user asks for them — work from conversation context, not intermediate files.

在代码中:默认不写注释。永远不要写多段落的文档字符串或多行注释块——最多一行短注释。除非用户要求,否则不要创建计划、决策或分析文档——从对话上下文中工作,而不是中间文件。

But for a certain subset of prompts, this guidance would be wrong. In the case of documentation, the user may have their own preferences, or specific parts of very complex code might need multi-line comment blocks.

但对于某些特定的提示词,这种指导是错误的。在文档的情况下,用户可能有自己的偏好,或者非常复杂的代码的特定部分可能需要多行注释块。

Still, without these guardrails for older models, the comments Claude wrote would be incorrect in many cases and we had to accept this tradeoff. But newer models have better judgement and can handle these decisions well without explicit rules.

尽管如此,如果没有这些针对旧模型的护栏,Claude 编写的注释在许多情况下会是不正确的,我们不得不接受这种权衡。但较新的模型具有更好的判断力,可以在没有明确规则的情况下很好地处理这些决策。

In the new system prompt we say: Write code that reads like the surrounding code: match its comment density, naming, and idiom.

在新的系统提示词中我们说:编写读起来像周围代码的代码:匹配其注释密度、命名和习惯用法。

Then: Give Claude examples Now: Design interfaces The number one rule for tool usage was to give Claude examples on how to use them. With our newest models, we’ve found that giving examples actually constrains them to a certain exploration space.

过去:给 Claude 提供示例 现在:设计接口 工具使用的第一条规则是给 Claude 提供如何使用它们的示例。对于我们最新的模型,我们发现提供示例实际上将它们限制在特定的探索空间中。

Instead of using examples, think more about the design of your tools, scripts and files- what parameters does Claude have and how can they be more expressive?

与其使用示例,不如多思考你的工具、脚本和文件的设计——Claude 有哪些参数,它们如何更具表现力?

For example, in the Todo tool example, just listing status as an enumeration between pending, in_progress, and completed, hints to Claude about how to use it. The instruction on keeping one item in_progress helps define our requested behavior.

例如,在 Todo 工具示例中,只需将状态列为 pending、in_progress 和 completed 之间的枚举,就能向 Claude 提示如何使用它。关于保持一个项目为 in_progress 的指令有助于定义我们请求的行为。

Then: Put it all upfront Now: Use progressive disclosure

过去:把所有东西放在前面 现在:使用渐进式披露

Because Claude Code was focused on coding, our system prompt included detailed information on how to do code review and verification. These were not always needed, but when they were, it was crucial information.

因为 Claude Code 专注于编码,我们的系统提示词包含了关于如何进行代码审查和验证的详细信息。这些并不总是需要的,但当需要时,它是至关重要的信息。

Since then, Claude Code has gotten very competent at using progressive disclosure- loading the right context at the right times. For example, we moved verification and code review into their own skills that Claude Code could selectively call.

从那时起,Claude Code 在使用渐进式披露(Progressive Disclosure)方面变得非常能干——在正确的时间加载正确的上下文。例如,我们将验证和代码审查移到了它们自己的技能(Skills)中,Claude Code 可以选择性地调用它们。

But progressive disclosure is not just for skills, we also use it for tools. Some of our tools are ‘deferred loading,’ which means the agent must search for their full definitions using ToolSearch before using them. This allows us to have more tools (such as our Task tools) that don’t take up context until they’re needed.

但渐进式披露(Progressive Disclosure)不仅适用于技能(Skills),我们也将其用于工具。我们的一些工具是“延迟加载”的,这意味着智能体(Agent)在使用它们之前必须使用 ToolSearch 搜索它们的完整定义。这允许我们拥有更多的工具(例如我们的 Task 工具),这些工具在需要之前不会占用上下文。

The same can be applied to your own CLAUDE.md and Skill.md files. A common myth is that you want to make these a central repository for every known practice that you might run into, because Claude would not find it otherwise. Instead, consider having a tree of files that can be loaded at the right time.

这同样适用于你自己的 CLAUDE.md 和 Skill.md 文件。一个常见的误区是,你想让这些文件成为你可能遇到的每个已知实践的中央存储库,因为否则 Claude 就找不到它。相反,考虑拥有一个可以在正确时间加载的文件树。

Then: Repeat yourself Now: Simple tool descriptions

过去:重复你自己 现在:简单的工具描述

Earlier Claude models could sometimes need repeated instructions or be more likely to listen to instructions at the end of their context window than at the start. This meant our system prompt would sometimes have references to tools in the main system prompt as well as instructions in the tool description.

早期的 Claude 模型有时可能需要重复的指令,或者更有可能听从上下文窗口末尾的指令,而不是开头的指令。这意味着我们的系统提示词有时会在主系统提示词中引用工具,并在工具描述中包含指令。

We found we could delete these repeat examples and put instructions on how to use tools in the tool descriptions rather than the system prompt.

我们发现我们可以删除这些重复的示例,并将如何使用工具的指令放在工具描述中,而不是系统提示词中。

Then: Memory in CLAUDE.md files Now: Auto-memory

过去:在 CLAUDE.md 文件中记录记忆 现在:自动记忆

We used to encourage users to save things to Claude’s memory, by using the # hotkey to write to their CLAUDE.md automatically. Instead, Claude now automatically saves memories that are relevant to the work and to you.

我们过去鼓励用户通过使用 # 快捷键自动写入他们的 CLAUDE.md 来将内容保存到 Claude 的记忆中。相反,Claude 现在会自动保存与工作和你相关的记忆。

Then: Simple specs Now: Rich references

过去:简单的规范 现在:丰富的参考资料

In plan mode, Claude Code has heavily relied on markdown files with plans. Storing these files as plans helped Claude refer to them when needed. Another similar best practice was to store specs in the codebase for Claude to refer to while working across longer projects.

在计划模式下,Claude Code 严重依赖带有计划的 Markdown 文件。将这些文件存储为计划有助于 Claude 在需要时参考它们。另一个类似的最佳实践是将规范存储在代码库中,以便 Claude 在处理较长项目时参考。

But we’ve found that Claude can handle increasingly more complicated references. Instead of simple markdown files, Claude can reference HTML artifacts created by our new artifacts feature.

但我们发现 Claude 可以处理越来越复杂的参考资料。Claude 可以参考由我们新的工件(Artifacts)功能创建的 HTML 工件,而不是简单的 Markdown 文件。

You may also give Claude references in the form of code. A spec may also be a detailed test suite, or a function in a different codebase that Claude might port.

你也可以以代码的形式给 Claude 提供参考资料。规范也可以是详细的测试套件,或者是 Claude 可能移植的不同代码库中的函数。

Rubrics are another form of references. Rubrics allow Claude to try and verify your taste in a particular field (e.g. what does a good API design look like) by using dynamic workflows and spinning up verifier agents with those rubrics.

评分标准(Rubrics)是另一种形式的参考资料。评分标准(Rubrics)允许 Claude 尝试通过使用动态工作流并使用这些评分标准启动验证器智能体(Verifier Agents)来验证你在特定领域的品味(例如,好的 API 设计是什么样的)。

Applying this to your context

将此应用于你的上下文

Pulling this all together, what does this look like when you assemble your context?

将所有这些结合起来,当你组装你的上下文时,这看起来像什么?

System Prompt A system prompt is heavily tied to the product context. It tells Claude what product it’s operating in and what it’s doing. For Claude Code, you will likely never modify this, but if you are building your own agent harness, this is where you should spend a lot of time.

系统提示词 系统提示词与产品上下文紧密相连。它告诉 Claude 它在什么产品中运行以及它在做什么。对于 Claude Code,你可能永远不会修改它,但如果你正在构建自己的智能体工具(Agent Harness),这是你应该花大量时间的地方。

CLAUDE.md Keep your CLAUDE.md lightweight and briefly describe what your repo is for, but spend most of the tokens on gotchas inside of the codebase. For example, you may organize your code to keep types in one monolithic file and nowhere else. Avoid stating ‘the obvious’ things Claude should know by looking at your file system or your repo.

CLAUDE.md 保持你的 CLAUDE.md 轻量级,并简要描述你的代码库的用途,但将大部分 Token 花在代码库内部的陷阱上。例如,你可能会组织你的代码,将类型保存在一个单一的文件中,而不在其他任何地方。避免陈述 Claude 通过查看你的文件系统或代码库应该知道的“显而易见”的事情。

Use progressive disclosure for more details, for example if you have several unique instructions on how to verify your work, create a verification skill and reference it from your CLAUDE.md.

使用渐进式披露(Progressive Disclosure)获取更多细节,例如,如果你有几个关于如何验证工作的独特指令,创建一个验证技能(Skill)并从你的 CLAUDE.md 中引用它。

Skills Think of skills as lightweight guides to let Claude find information when needed. Avoid making them overconstrained, except in highly important areas.

技能(Skills) 将技能(Skills)视为轻量级指南,让 Claude 在需要时找到信息。避免使它们过度受限,除非在非常重要的领域。

For long skills, try and use progressive disclosure as much as possible- divide it into many files and split them out.

对于较长的技能(Skills),尽量多使用渐进式披露(Progressive Disclosure)——将其分成许多文件并拆分它们。

It’s best when skills encode particular opinions, knowledge, or best practices that are particular to you, your team, or product.

当技能(Skills)编码了特定于你、你的团队或产品的特定观点、知识或最佳实践时,效果最好。

References You can @ mention files to include them as references. References allow Claude to refer to in-depth information about the current plan.

参考资料 你可以 @ 提及文件以将它们作为参考资料包含在内。参考资料允许 Claude 参考有关当前计划的深入信息。

This might be in specs files, mockups, or even entire codebases. Generally you should prefer files that are in code as it provides clear, high-fidelity instructions to Claude in a language it knows very well. For example, a HTML mockup of a design will generally produce better results than a description of the design or a screenshot.

这可能在规范文件、模型或甚至整个代码库中。通常你应该更喜欢代码中的文件,因为它用 Claude 非常了解的语言为 Claude 提供了清晰、高保真的指令。例如,设计的 HTML 模型通常会比设计的描述或屏幕截图产生更好的结果。

Try simplifying

尝试简化

Across your system prompt, skills, and CLAUDE.md files, you may need to simplify just like we did. We rolled out a new command called claude doctor, which will help you do this automatically as well. For more details on prompting more advanced models specifically, check out our Fable field guide.

在你的系统提示词、技能(Skills)和 CLAUDE.md 文件中,你可能需要像我们一样进行简化。我们推出了一个名为 claude doctor 的新命令,它也将帮助你自动执行此操作。有关专门为更高级模型编写提示词的更多详细信息,请查看我们的 Fable 现场指南。

We removed ~80% of the Claude Code system prompt for our newest models, this is what we've learned about writing system prompts, skills and Claude.MDs for them. http://x.com/i/article/2080703729385512960

I’ve written previously about how to best prompt the newest generation of Claude 5 models and work with them iteratively to discover what you want to build.

But when you send a message to Claude, the prompt is only a small part of the context it gets. Much of your context is assembled from your system prompt, Skills, CLAUDE.md files, memory, and other sources. We call this context engineering, and it makes a big impact on the results you generate when using Claude Code or in building your own agents.

Unlike a prompt, context is used generally across many requests, so it cannot be as specific. How do you build these general prompts and guidance for Claude, especially when you don’t know what a user’s prompt might be?

This can be surprisingly difficult as Claude’s own capabilities evolve. Most recently, we noticed a large jump in the way we prompt the newest generation of Claude models. We removed over 80% of Claude Code’s system prompt for models like Claude Opus 5 and Claude Fable 5 with no measurable loss on our coding evaluations.

Here’s what we’ve learned about prompting this new class of models, and how you can utilize it to update your context engineering. We’ve put these best practices in claude doctor, use the command /doctor in Claude Code to rightsize your skills, and CLAUDE.md files.

Unhobbling Claude

Overall, we found that we were over-constraining Claude Code, both through our system prompt and in our CLAUDE.md files and skills.

For example, when we read transcripts of our own internal usage of Claude Code, we see several conflicting messages in a single request like “leave documentation as appropriate,” or “DO NOT add comments” as our system prompt, skills, and user requests clash with each other.

https://claude.com/blog/a-field-guide-to-claude-fable-finding-your-unknowns

Generally, Claude can interpret the user’s intent to get to the right answer, but Claude must think more carefully about these overlapping and conflicting messages before deciding what to do.

And while these constraints were once needed to avoid worst case scenarios, we have since found we can delete many of them and let the model use surrounding context and judgement instead.

Additionally, Claude Code now has many more tools. Claude used to rely on CLAUDE.md as a source of memory, information, and guidance. Now we have memory, artifacts, and skills, which Claude can use to create new ways of loading and sharing context across sessions.

Then and now

There were a number of previous context engineering best practices that had become myths. Including:

https://claude.com/blog/a-harness-for-every-task-dynamic-workflows-in-claude-code

** Then: Give Claude rules Now: Let Claude use judgement **When we first rolled out Claude Code, we needed to be sure that Claude avoided worst case scenarios, such as deleting files. This meant we would give particularly strong guidance that might not always be true, For example, in the system prompt we used to say:

In code: default to writing no comments. Never write multi-paragraph docstrings or multi-line comment blocks — one short line max. Don't create planning, decision, or analysis documents unless the user asks for them — work from conversation context, not intermediate files.

But for a certain subset of prompts, this guidance would be wrong. In the case of documentation, the user may have their own preferences, or specific parts of very complex code might need multi-line comment blocks.

Still, without these guardrails for older models, the comments Claude wrote would be incorrect in many cases and we had to accept this tradeoff. But newer models have better judgement and can handle these decisions well without explicit rules.

In the new system prompt we say: Write code that reads like the surrounding code: match its comment density, naming, and idiom.

Then: Give Claude examples Now: Design interfaces The number one rule for tool usage was to give Claude examples on how to use them. With our newest models, we’ve found that giving examples actually constrains them to a certain exploration space.

http://claude.md/

Instead of using examples, think more about the design of your tools, scripts and files- what parameters does Claude have and how can they be more expressive?

For example, in the Todo tool example, just listing status as an enumeration between pending, in_progress, and completed, hints to Claude about how to use it. The instruction on keeping one item in_progress helps define our requested behavior.

Then: Put it all upfront Now: Use progressive disclosure

Because Claude Code was focused on coding, our system prompt included detailed information on how to do code review and verification. These were not always needed, but when they were, it was crucial information.

Since then, Claude Code has gotten very competent at using progressive disclosure- loading the right context at the right times. For example, we moved verification and code review into their own skills that Claude Code could selectively call.

But progressive disclosure is not just for skills, we also use it for tools. Some of our tools are ‘deferred loading,’ which means the agent must search for their full definitions using ToolSearch before using them. This allows us to have more tools (such as our Task tools) that don’t take up context until they’re needed.

The same can be applied to your own CLAUDE.md and Skill.md files. A common myth is that you want to make these a central repository for every known practice that you might run into, because Claude would not find it otherwise. Instead, consider having a tree of files that can be loaded at the right time.

Then: Repeat yourself Now: Simple tool descriptions

Earlier Claude models could sometimes need repeated instructions or be more likely to listen to instructions at the end of their context window than at the start. This meant our system prompt would sometimes have references to tools in the main system prompt as well as instructions in the tool description.

We found we could delete these repeat examples and put instructions on how to use tools in the tool descriptions rather than the system prompt.

Then: Memory in CLAUDE.md files Now: Auto-memory

We used to encourage users to save things to Claude’s memory, by using the # hotkey to write to their CLAUDE.md automatically. Instead, Claude now automatically saves memories that are relevant to the work and to you.

Then: Simple specs Now: Rich references

In plan mode, Claude Code has heavily relied on markdown files with plans. Storing these files as plans helped Claude refer to them when needed. Another similar best practice was to store specs in the codebase for Claude to refer to while working across longer projects.

But we’ve found that Claude can handle increasingly more complicated references. Instead of simple markdown files, Claude can reference HTML artifacts created by our new artifacts feature.

You may also give Claude references in the form of code. A spec may also be a detailed test suite, or a function in a different codebase that Claude might port.

Rubrics are another form of references. Rubrics allow Claude to try and verify your taste in a particular field (e.g. what does a good API design look like) by using dynamic workflows and spinning up verifier agents with those rubrics.

Applying this to your context

Pulling this all together, what does this look like when you assemble your context?

https://claude.com/blog/a-harness-for-every-task-dynamic-workflows-in-claude-code

System Prompt A system prompt is heavily tied to the product context. It tells Claude what product it’s operating in and what it’s doing. For Claude Code, you will likely never modify this, but if you are building your own agent harness, this is where you should spend a lot of time.

CLAUDE.md Keep your CLAUDE.md lightweight and briefly describe what your repo is for, but spend most of the tokens on gotchas inside of the codebase. For example, you may organize your code to keep types in one monolithic file and nowhere else. Avoid stating ‘the obvious’ things Claude should know by looking at your file system or your repo.

Use progressive disclosure for more details, for example if you have several unique instructions on how to verify your work, create a verification skill and reference it from your CLAUDE.md.

Skills Think of skills as lightweight guides to let Claude find information when needed. Avoid making them overconstrained, except in highly important areas.

For long skills, try and use progressive disclosure as much as possible- divide it into many files and split them out.

It’s best when skills encode particular opinions, knowledge, or best practices that are particular to you, your team, or product.

References You can @ mention files to include them as references. References allow Claude to refer to in-depth information about the current plan.

This might be in specs files, mockups, or even entire codebases. Generally you should prefer files that are in code as it provides clear, high-fidelity instructions to Claude in a language it knows very well. For example, a HTML mockup of a design will generally produce better results than a description of the design or a screenshot.

Try simplifying

Across your system prompt, skills, and CLAUDE.md files, you may need to simplify just like we did. We rolled out a new command called claude doctor, which will help you do this automatically as well. For more details on prompting more advanced models specifically, check out our Fable field guide.

📋 讨论归档

讨论进行中…