Frontier Log

Claude Fable 5.2 Avoids Refactoring

Anthropic's guides for Claude Fable 5 and 5.1 gave prompts to stop unasked code changes. Its Fable 5.2 guide gives a line to start the model refactoring.

Three cells, code beyond the task in Anthropic's guides. Claude Fable 5, Jun 2026: could refactor unasked at higher effort. Claude Fable 5.1, Sep 2026: might fix nearby code. Claude Fable 5.2, Nov 2026: tended to leave code alone. Anthropic's suggested prompt line: This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it. Then three bars, tries where it then refactored duplicate code: under a tenth without the sentence, about half with the sentence, about a third with the sentence and a no drive-by refactors rule.
Anthropic's guides for Claude Fable 5 and 5.1 offered prompts to stop unasked code changes. Its Fable 5.2 guide offers a line to start refactoring. In Anthropic's tests, Fable 5.2 refactored duplicate code in under a tenth of tries without the line and in about half with it. Download
ModelLaunchedCode beyond the task, in Anthropic's guide
Claude Fable 5Jun 2026Could refactor unasked at higher effort: the guide gives a prompt "to prevent unrequested tidying or refactoring at higher effort"
Claude Fable 5.1Sep 2026Might fix nearby code: "it might fix nearby code, extend behavior the task didn't mention"
Claude Fable 5.2Nov 2026Tended to leave code alone: it "tended to add to the existing structure, even when that repeated existing code"
Prompt in Anthropic's test of Claude Fable 5.2Tries where it refactored duplicate code
Without the lineUnder a tenth
With the lineAbout half
With the line and a "No drive-by refactors, renames or cleanups" ruleAbout a third

Anthropic's prompting guide for Claude Fable 5.2 says the model tends to leave existing code as it is unless the prompt says the code is the model's own. The model launched on Nov 9. Anthropic's guides for Claude Fable 5, launched on Jun 9, and Claude Fable 5.1, launched on Sep 1, each gave developers a prompt to stop those models changing code beyond the task.

Earlier guides told developers how to stop it

The Fable 5 guide gives a prompt "to prevent unrequested tidying or refactoring at higher effort". The prompt opens: "Don't add features, refactor, or introduce abstractions beyond what the task requires." The Fable 5.1 guide says that model "delivers what's asked for and sometimes more: it might fix nearby code, extend behavior the task didn't mention, or commit more test files than the change warrants". Its prompt tells the model to report such a find as a follow-up.

The guides don't compare the three models on one test. Only the Fable 5.2 guide reports a test with rates, and Anthropic doesn't give a figure for the earlier models on it.

One line took refactoring from under a tenth to about half

Anthropic tested Fable 5.2 on small coding tasks. When a prompt said nothing about ownership or presented the code as someone else's, the model "tended to add to the existing structure, even when that repeated existing code". It also tended to report nearby problems instead of fixing them.

The line Anthropic suggests reads: "This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it." With it, the model "merged repeated code in about half of the tries". Without it, the model did so in under a tenth. The guide sets merging repeated code against adding "to the existing structure, even when that repeated existing code", and this story calls it refactoring. The rate varied by task, and the result held when the line stood inside a long system prompt. The requested feature worked in nearly every try either way.

A rule against refactors didn't cancel the line

Anthropic also put "No drive-by refactors, renames or cleanups" earlier in the same prompt. The model still refactored duplicate code in about a third of the tries.

The line had other effects in the same testing. The model used about 1.5 times the output tokens and made several changes that nobody had asked for, "many of them new tests and documentation". Apart from bug fixes, it changed how an existing feature behaves in one try in six to ten, and more often at higher effort. Its closing summary often left out small changes. The guide says to leave the line out where the user owns the code and wants it changed as little as possible. It doesn't name the tasks or say how many tries Anthropic ran.

The model's prices per token are in Claude Fable API Prices, Fable 5 to 5.2.

Sources

Models

Related

Tags