跳到正文
Simon Willison·· 2 小时前AI 评分36

Anthropic 文档:如何提示 Claude Fable 5.2 重构代码结构

Quoting Prompting Claude Fable 5.2

AI 导读

Anthropic 文档披露 Claude Fable 5.2 对提示词中代码归属表述敏感:提示词未提归属或把代码库说成他人的,模型倾向沿用现有结构,即使重复代码也照抄。若写明"代码库是你的",模型在小型编码任务中约一半尝试会合并重复代码,不加这句时不足十分之一。

正文 · 原文

10th November 2026

Claude Fable 5.2 responds closely to what the prompt says about who owns the code it works on. In Anthropic’s testing on small coding tasks, when a prompt said nothing about ownership or presented the code base as someone else’s, the model tended to add to the existing structure, even when that repeated existing code. [...]

If you want the model to improve the structure as it works, say that the code is its own:

This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it.

In Anthropic’s testing on small coding tasks, the model merged repeated code in about half of the tries with this sentence, and in under a tenth of the tries without it.

— Prompting Claude Fable 5.2, Anthropic documentation

来源:Simon Willison · simonwillison.net