Claude Code 80% System Prompt 缩减:Fable 5 时代的 Prompt 反模式复盘 · 干货攻略

  • 链接:https://x.com/simonw/status/2079553486568800405
  • 分类:x-tips
  • 来源:X @simonw
  • 作者:Jay
  • 更新:2026-07-27

这是什么

2026 年 7 月,Anthropic 将 Claude Code 的 system prompt 裁剪了 80%,用于最新一代 Claude 5 模型(Opus 5、Fable 5,又称 Mythos 系列)。结果:coding eval 无任何可测量的质量下滑

这一举动揭示了 Claude 5 时代最重要的 prompt 认知反转:塞入大量示例、禁止清单和刚性规则的 system prompt,如今对模型是一种约束而非帮助。

原帖来源 @simonw(Simon Willison):"I got some really useful Claude prompting tips from @_catwu and @trq212 — it's time to stop overloading our prompts with examples and lists of things not to do, Fable works better without those."

为什么值得关注

谁分享的

这场分享来自 Anthropic Claude Code 团队两位核心成员: - @trq212(Thariq Shihipar)— Anthropic Member of Technical Staff,Claude Code 系统 prompt 的实际维护者 - @_catwu(Cat Wu)— Claude Code 产品工程负责人

Simon Willison 在 AI Engineer World's Fair 2026 主持了一场炉边对话,完整视频和带注释的笔录均已公开发布(simonwillison.net/2026/Jul/21/cat-and-thariq)。

解决了什么问题

过去一年里,Claude Code 用户群体普遍形成了一套"最佳实践": - System prompt 里塞入几十条规则:"不要做 X,不要做 Y,做 Z 时用 W" - 用大量示例(few-shot)来教会模型如何使用工具 - 在 CLAUDE.md 里事无巨细地记录团队规范

这套方法在 Sonnet 3.7/4.x 时代确实有效。但随着 Fable 5(Mythos 级模型)到来,Anthropic 内部发现:这些约束不仅多余,还在帮倒忙。

核验过程

官方来源(已读)

来源 内容摘要
The Decoder 报道(2026-07-02) Tariq Shihipar 原话:"Most recently we found this new class of models want a smaller system prompt",examples "tend to constrain it because it's actually more imaginative than the examples we give it"
simonwillison.net 注释笔录(2026-07-21) 团队内部分享完整内容;Top-level note 明确:"Adding examples to a system prompt is no longer best practice for models like Fable 5 or even Opus 4.8. The Claude Code system prompt recently reduced in size by 80%."
trq212 X 主帖(2026-07-24,3.9M 浏览) 官宣博文,标题"The new rules of context engineering for Claude 5 models",指向 Claude 官方博客全文
explainx.ai 解读 整理了六条新规则的系统性解读
mager.co 分析文(2026-07-24) 详细解析"unhobbling"概念;以具体代码注释规则为 case study 说明旧规则的副作用

交叉验证结论

  • 80% 缩减 + eval 无损失:经 The Decoder(独立科技媒体)、trq212 X 原帖(3.9M 浏览)、mager.co 三方交叉确认,数字一致,无冲突。
  • 模型适用边界:官方明确指出适用于 Opus 5 / Fable 5(即 Mythos 类模型),Simon 笔录补充说 "even Opus 4.8" 也开始受益。Sonnet 4.x 及更早模型不在此列。
  • 具体反模式:减少示例(few-shot → 不给示例)、减少禁止清单("never do X")、用上下文引导替代硬规则。原帖主张:"Write code that reads like the surrounding code" 替代 "default to writing no comments",此为 trq212 分享的具体案例,来自笔录原文,未经独立二次验证,但与 The Decoder 报道中 Tariq 原话逻辑一致。

上手步骤

立即可用的 6 条新规则

以下规则适用于 Opus 5 / Fable 5 及更新模型。

1. 规则 → 判断力(Rules → Judgment)

旧做法:

Never write multi-paragraph docstrings. One short line max.

新做法:

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

思路:停止写 "never do X",除非你能举出一个模型无法自行推理出的具体失败案例。让模型读上下文,自己判断。

2. 示例 → 接口设计(Examples → Interface Design)

旧做法:

// Example: Use createUser({ name: "Alice", role: "admin" })

新做法:

type Role = "admin" | "viewer" | "editor";
function createUser(opts: { name: string; role: Role }): User { ... }

思路:用类型签名(enum、schema)替代示例。类型约束比示例更精准,且不会把模型框死在窄小的探索空间。

3. 全量 upfront → 渐进披露(Progressive Disclosure)

CLAUDE.md 精简到只含: - 仓库目的(1-2 句) - 真正的 gotcha(模型读代码读不出来的历史决策或依赖怪癖)

流程性内容移入 Skills

# .claude/commands/verify.md
---
description: Run verification suite on modified files
---
Run the project test suite against any files modified in this session.
Exit code 0 = pass, non-zero = failures.

Skills 支持 deferred 加载,Claude Code 搜索工具时才展开完整 schema,不需要在每次请求里都占 context。

4. 重复指令 → 单一来源(Repeated Instructions → Single Source)

旧做法:同一条规则同时出现在 system prompt + tool description 里作为"强化"。

新做法:指令只出现一次,放在它所属的位置(tool description 里的放 tool description,skill 里的放 skill)。删除所有镜像副本。

5. 手动记忆 → 自动记忆

Claude Code 现已支持自动保存相关记忆。不要再把 CLAUDE.md 当作记忆存储,让它保持轻量。

6. 简单规格 → 丰富参考(Rich References)

Markdown 格式的 spec 文档 HTML 模拟稿 / 可运行的测试套件
文字描述期望输出 Rubric(结构化的"好"的标准)

/doctor 自动诊断

Claude Code 内置 /doctor 命令,可扫描你当前的 CLAUDE.md 和 Skills,指出哪些规则是冗余的、冲突的或可精简的。运行它,用输出指导删减。

# 在 Claude Code 会话中直接运行
/doctor

CLAUDE.md 重构检查清单

对每一条显式规则问自己:

如果 Claude 读懂周围代码并理解用户意图,它自己能做对吗?

  • → 删除这条规则
  • 不能 → 保留,但确保它没有与 system prompt / skill / tool description 里的其他规则冲突

坑与适用边界

⚠️ 只适用于 Claude 5 系列

这条规则的反转明确适用于 Opus 5 / Fable 5(Mythos 级模型)。Sonnet 4.x、Haiku 更早模型不适用——它们的 system prompt 行为仍遵循"给越多指令越听话"的旧范式。

⚠️ 不要一股脑删光所有规则

Anthropic 的做法是删了 80% 还有 20% 保留。真正有价值的 gotcha(如"我们把所有类型放 types.go,不放其他任何地方")仍有必要保留——模型读代码读不出这个决策背后的历史原因。

⚠️ 减少示例不等于零示例

对于边界情况(模型很容易搞错的特定输入组合),给出 1-2 个精准示例仍然有用。但通用场景下,用类型签名和接口设计替代散弹式示例。

⚠️ Skill 文件过大是另一个瓶颈

trq212 在推文中特别提到:Skill 文件过大(overly specific skills)同样会损害 Claude 5 表现。/doctor 也会标记这类问题。Skill 应该小而专注,一个 Skill 只编码一个具体工作流或观点。

⚠️ Prompt 惯性陷阱

Simon Willison 本人在笔录中也承认:"Giving it examples was one of my top prompting tips. If that's no longer true, that kind of breaks my prompting model." 这说明整个行业都需要更新肌肉记忆。

一句话结论

Claude 5 时代,给模型更多判断空间、少塞规则——用 /doctor 扫描你的 CLAUDE.md 和 Skills,从删掉 20% 开始。