Willison引介Fable 5.2提示对照:代码归属表述会影响重构倾向
Willison摘引Anthropic指南中的小型编码任务测试:加入将代码库视为模型自有的提示后,合并重复代码的比例由不足一成升至约一半。这类提示会鼓励主动调整结构,只适合允许重构的任务;该结果来自厂商测试,不能当作普适的质量提升。
为编码Agent提示词调整提供具体对照;原文正文+原站 RSS 时间核验,并对照官方指南确认了额外改动风险,未独立复测。
10th November 2026
Claude Fable 5.2 pays close attention to who owns the code it works on. In Anthropic’s testing on small coding tasks, the model tended to add to the existing structure when the prompt said nothing about ownership or presented the code base as someone else’s, even when that duplicated existing code. When the prompt said the code base was the model’s own, it often consolidated duplicated code and sometimes made related fixes without being asked.
If you want the model to improve the structure as it works, say that the code is its own:
You are the owner and long-term maintainer of this codebase, and its design is up to you.The ownership sentence makes the model much more likely to consolidate duplicated code into one shared function. In Anthropic’s testing on small coding tasks, the model consolidated duplicated code in under 10 percent of runs without the sentence and in about 75 percent of runs with it.
— Prompting Claude Fable 5.2, Anthropic documentation
来源:Simon Willison · simonwillison.net