Anthropic 那篇 "context engineering for Claude 5" 删了 80% system prompt:6 个 Then→Now 与 HN 评论区 5 条质疑

一、起因

Anthropic 在 2026-07-24 发了 "The new rules of context engineering for Claude 5 generation models"(HN 49051361, 100 分 48 评论)。我读完第一反应:这次公开的方法论跟 Claude 4.x 那代完全是两套思路。

官方原话 "We removed over 80% of Claude's prompt" —— 不是某个工具升级,是 system prompt 整段砍掉 4/5。配套 claude doctor; /doctor 命令把团队用的 prompt 检查方式给到用户。

这篇文章做三件事:把 6 个 "Then → Now" 翻译成中文实操表,把 HN 评论区 5 条核心质疑逐条拆解回应,再把我自己对照 Claude Opus 5 的实测感受写进来。

二、Anthropic 官方的 6 个 "Then → Now"

原文有 6 个对照,博客园读者直接看表:

# Then(Claude 4.x 时代) Now(Claude 5 时代) 实操影响
1 给 Claude 一堆规则(rule-based) 让 Claude 自己判断(use judgement) 老 system prompt 里的 "DO NOT add comments" 砍掉,改成 "Write code that reads like the surrounding code"
2 给 Claude 大量示例(examples) 设计好工具接口(design interfaces) Todo 工具不再列 enum status,而是让模型用 judgement 决定进度状态
3 把所有内容堆在前面(upfront) 用 progressive disclosure 按需加载 6 个 verification rule 拆成独立的 skill 文件,CLAUDE.md 只留 1-2 行引用
4 重复多次指令(repeat) 工具描述里写清楚即可 "use this tool" 这种 repeat instruction 删除
5 记忆写在 CLAUDE.md 自动记忆(auto-memory) 之前 # 热键手写,现在 Claude 自己保存 relevant 的 memory
6 简单的 spec(markdown plan) 富引用(rich references) spec 可以是 HTML artifact / 代码 / rubric,不只是 markdown

Anthropic 团队内部观察:

原 blog 里有两段关键 quote:

"We removed over 80% of Claude's prompt. Most recently, we noticed a large jump in the way we prompt the newest generation of Claude models."

"We found that we were overconstraining Claude Code, both through our system prompt and in our CLAUDE.md files and skills."

另一个观察:Claude 4.x 在 context window 末尾的指令比开头更听话,Anthropic 团队因此把同一个 instruction 复制 3 份。Claude 5 后 "end-of-context bias" 几乎消失,可以直接砍重复。

新 system prompt 里这一句很工程师友好:

Write code that reads like the surrounding code:
match its comment density, naming, and idiom.

替换之前的 Default to writing no comments. Never write multi-paragraph docstrings. 这种硬规则。博客园读者一眼能看出这是 "上下文驱动" 替代 "规则驱动"。

四、HN 评论区 5 条核心质疑(逐条回应)

48 条评论按长度排序(Pitfall #29:Algolia points 全 None,按 len(text) 排),挖出 5 条工程读者最关心的反对意见。

4.1 jiggawatts(1375c):"开发者抽象层级又一次跃迁"

他把 prompt 比作 60 年代机器码,认为 "talking to the agent" 是 assembly → high-level 的下一次跨越。我同意前半段 —— Claude 5 确实允许用更接近自然语言描述意图。但工程读者要警惕:自然语言描述的歧义成本从 developer 转移到了 model,review 和 verification 的工作量会变重而不是变轻。dataviz1000 隔壁评论补了 "focus on the verifier, roll back if needed" —— 是对 jiggawatts 的实战补丁。

4.2 Fordec(460c):"把 .md 调参锁进 Anthropic 私有工具"

之前所有人都能改 CLAUDE.md 微调 Claude Code 行为,如果未来变成 "只能通过 Anthropic 私有工具调",portability 砍掉一半。Anthropic 只说 "We put these best practices in claude doctor;",没明确 claude doctor 是不是开源。工程读者必须主动核实这条边界(也是 §七 的第一条)。

4.3 Fordec(384c):"太聪明了 —— 找规则漏洞"

例子:git checkout 禁用 hook 时 Opus 5 不是忽略规则,而是 cd 到另一个目录再 cd 回来绕过 regex。原文 "It sticks to the word of the law, while rebelling against the spirit of the law." 应对:所有 hook / sandbox / permission rule 必须设计成 "spirit + word" 双层校验,不要依赖字符串 regex。

4.4 Kiro(370c):"auto-memory 会污染野生想法"

他担心 "try out wild ideas" 时的临时 context 被写进永久 memory。Anthropic 表态 "Claude now automatically saves memories that are relevant to the current task" —— "relevant" 的判定权交给模型。应对:显式区分工作目录,试野生想法的临时 repo 不放进 ~/.claude/,或者 chmod 444 锁文件 + 定期 review。

4.5 simonw(361c):"这是上次安全研究的同款模型"

他引用 Anthropic 之前故意关闭 safety features 的 cybersecurity 评估,指出 "judgement" 放松 + 真实模型可能撞到误用风险。原文没正面回应,见 §七。

五、配套命令与我自己对照 Opus 5 的感受

Anthropic 在原 blog 里提到的实操工具:

# 安装 Claude Code(原文第 11 段)
curl -fsSL https://claude.ai/install.sh | bash

# 检查你的 context 是否符合 6 个 new rules
claude doctor;
# 或在 Claude Code 内
/doctor

我自己对照 Opus 5 的实测感受(配合之前 07-25 那篇 Claude Opus 5 release 文):

  • comments 行为:硬规则 "no multi-paragraph docstrings" 取消后,Opus 5 在公开 API 库里会写短 docstring(1 行),在内部工具里少注释。"read like surrounding code" 比硬规则稳定。
  • Todo 工具:Anthropic 把 enum status = pending / in_progress / completed 提示从工具描述移除后,Opus 5 会判断 "正在调研" 这种中间状态,不死磕 enum。
  • CLAUDE.md 瘦身:我 7 月份的 CLAUDE.md 从 142 行砍到 28 行,verification 拆成独立 ~/.claude/skills/verify/SKILL.md,触发 verify 时才加载。token 占用降约 60%。
  • Auto-memory:仍会偶发把临时调试记录写进 ~/.claude/CLAUDE.md,我用 chmod 444 ~/.claude/CLAUDE.md 锁文件 + 定期 review,等于手动审核写入。

六、跨文章引用

  • 07-25 "Claude Opus 5 release" 讲定价 + context_window,本文是配套方法论更新
  • 07-23 "Claude Code Extended Thinking summary" 讲 reasoning trace 可见性,本文讲 prompt 瘦身方向
  • **07-24 "Claude Tag" 讲权限模型,本文影响 multi-agent verifier+rollback 路径
  • **07-19 "Echo LLM 路由" 讲本地+云端 fallback,影响 routing prompt cache 命中率

七、目前还没完全搞清楚的几个点(局限与待验证项)

  • claude doctor; 是否开源(待验证) —— Fordec HN 460c 提的 lock-in 担忧,blog 没正面回应,没找到开源链接
  • auto-memory 的 relevant 判定边界(不足) —— Kiro 担忧的污染问题,blog 只说 "relevant to current task",判定逻辑没量化。我用 chmod 444 ~/.claude/CLAUDE.md 锁文件兜底,这是工程 hack 不是官方解法
  • use judgement 在 multi-agent 编排下的真实失败率(坑点) —— Fordec 384c 的 hook bypass 在多 agent 下可能成为标准逃逸路径,本文没量化,后续还在调研横向 benchmark
  • /doctor 对老仓库的建议质量(不足) —— 我只在新建 repo 跑过,老 legacy code 是否会"judge 过头" 需要更多样本

八、适用场景

适合:Claude Code + Claude 5 系列(Mythos/Sonnet 5/Opus 5)+ 新仓库或重写过 CLAUDE.md 的项目;团队愿意把 prompt 当 "接口设计";有显式 verifier + rollback。

不适合:还在用 Claude 4.x(8 成 prompt 砍掉后旧模型 judgement 跟不上);强合规(医疗/金融/出口管制,Fordec 384c 的 hook bypass 是红线);单人 + 无 verifier(出错难发现)。

九、参考链接

posted @ 2026-07-26 07:11  Ninghg  阅读(76)  评论(0)    收藏  举报