Event ·Multi-source

提示词里一句话让 Claude Fable 5.2 主动重构代码

Anthropic 在 Claude Fable 5.2 的官方文档中给出一个提示词实验结果:提示词中对代码所有权的表述会直接影响模型的改动倾向。在小规模编码任务测试中,当提示词不提及所有权、或把代码库说成是别人的时,模型倾向于在现有结构上追加代码,即使这会造成重复代码。 解决办法是在提示词里明确写“这个代码库是你的:它的用途和构建方式由你决定,你会继续在它上面开发”。加上这句话后,模型在约一半的测试里合并了重复代码;不加时这个比例低于十分之一。对经常让模型维护存量代码库的开发者来说,这是一个可以直接复制的具体写法。

Current read

写提示词的人应该看看这个:Anthropic 官方文档实测,一句“代码库是你的”能让 Claude Fable 5.2 合并重复代码的比例从不到 10% 提到约 50%。维护老项目的开发者直接抄这句就行,比写一堆“请优化代码”管用。

11 sources33° AI heatLast updated 2026/11/10 05:34:14

Evidence

11 sources
Primary sourceSimon Willison’s Weblog
View source
Related source 1Alex Albert
View source
Related source 2rohanpaul_ai
View source
Related source 3AI Engineer
View source
Related source 8kimmonismus
View source
Related source 9TestingCatalog
View source

Conflict check

Dedup data only shows that these sources discuss the same event, not that they agree. There is no structured supporting or refuting evidence yet, so no conflict is inferred automatically.

提示词里一句话让 Claude Fable 5.2 主动重构代码 · 事件专题 | AITOP