
JQIT CorporationIf you write “This code is yours” in CLAUDE.md, will it consolidate duplicate code? I tested it 132 times with Claude Code, Codex, and Gemini CLI, and only Claude consolidated it.
- AI
- AI agents
- Claude
- ClaudeCode
- Generative AI
Anthropic has published guidance on how to write prompts for Fable 5.2 (“Prompting Claude Fable 5.2”). It includes a section on “stating who owns the code.” To summarize what it says:
| The guide’s claim | Figures from the original text |
|---|---|
| Without stating an owner, it adds to the existing code (even if that creates duplication) | Less than 10% consolidated duplicates |
| Writing “You are the owner and long-term maintainer of this codebase, and its design is up to you.” makes it start consolidating | About 75% |
| In return, output tokens increase, as do changes you did not request (such as tests or documentation) | Output tokens increase by 70–80% |
| Even putting “No drive-by refactors, renames or cleanups” (no incidental cleanup) first does not cancel this out | More than half consolidated duplicates |
The guide introduces this sentence as something to add to the system prompt. What we normally write are CLAUDE.md and AGENTS.md.I tested whether writing the same sentence there would work, and whether it would work with tools other than Claude, using Claude Code, Codex, and Gemini CLI.
Conclusion
| Conditions (6 runs each) | Fable 5.2 | Opus 5.5 | Codex | Gemini CLI |
|---|---|---|---|---|
| Write nothing | 0 times | 0 times | 0 times | 0 times |
| One English sentence in the instruction file | 6 times | 6 times | 0 times | 0 times |
| One Japanese sentence in the instruction file | 6 times | 5 times | 0 times | 0 times |
| “No drive-by refactors” + one English sentence | 0 times | 0 times | 0 times | 0 times |
(Number of times duplicated formatting logic was consolidated into a single shared function)
- By writing just one sentence in CLAUDE.md, Claude stopped copying the code and consolidated it into a shared function. The same was true when written in Japanese. If nothing was written, Fable 5.2, Opus 5.5, Codex, and Gemini CLI all added the code by copying it in all 6 of 6 runs.
- Codex and Gemini CLI did read the instruction file, but still copied everything in all 24 runs.
- Putting “No drive-by refactors” first brought Claude back to zero. This is the opposite of the guide’s claim that “more than half were consolidated.” Even when it was put in the system prompt and Fable 5.2’s effort was set to high, the result was still zero.
- The trade-off was instead an estimated 1.8× cost with Fable 5.2 (2.9× output tokens, 2.5× time), along with unrequested rewrites of files such as the README.
- Existing output was broken in 0 out of 132 runs. Claude reported the unrequested changes every time.
We tested only one small Node module.
How to test
The measurement was conducted on 2026-11-12.
| Item | Details |
|---|---|
| Tool | Claude Code 2.1.322 (`claude -p`, logged in to Max), Codex 0.166.0 (`gpt-6-luna`, free ChatGPT plan), Gemini CLI 0.66.0 (`gemini-3.8-flash`, free tier)|
| Claude models | Fable 5.2 and Opus 5.5. `effort` was not specified, so the default `medium` for `claude -p` was used (confirmed in the conversation record). Only Fable 5.2 was also tested with `high`. |
| Permissions | Claude Code used `acceptEdits`, permitting only Node commands and file reads/writes. Codex used `workspace-write`. Gemini CLI used `auto_edit`, permitting only Node commands. |
| Task | A module for generating store reports. In the three files for sales, refunds, and billing, the code for formatting amounts as "1,234 yen" and dates as "2026/11/12" has been duplicated in the same form. |
| Request (identical for all) | "Implement `returnReport` in `src/returns.js` according to the specification in the comment at the top of the file. Make it usable from `src/index.js` as well. Use `node --test` to verify that all the tests in `test/` pass." |
| Where to put the single sentence | Claude Code: `CLAUDE.md`; Codex: `AGENTS.md`; Gemini CLI: `GEMINI.md`. For Claude Code only, an additional condition was added: put it in the system prompt (`--append-system-prompt`). |
| Evaluation | If only one file has its own amount and date formatting, it is judged to be "consolidated." The three existing outputs were verified with hidden tests that compared them against the outputs produced by the original code. |
| Number of runs | Six runs per condition, 132 runs in total (Claude Code: 84; Codex: 24; Gemini CLI: 24) |
The returns report also needs the same amount and date formatting. The tools behave differently depending on whether another copy is added to the returns file or the formatting is consolidated into a shared function used by all four.
Only the billing file discards fractions of a yen from the consumption tax. Eliminating this difference during consolidation would change the existing output.
Adding one sentence made Claude stop copying
If I write nothing, both Fable 5.2 and Opus 5.5 copy the formatting logic as-is into the files they return. This follows the guide’s instruction to “add to the existing format.”
When I write a single English sentence in CLAUDE.md, Fable 5.2 creates src/format.js in all six runs and rewrites the three existing files to use it as well.
The final report clearly stated that the scope had been exceeded.
There is one area where work went beyond the requested scope. Since the date and amount formatting had been copied as-is into the three files for sales, refunds, and billing, I consolidated it into src/format.js (formatDate and formatYen) rather than adding a fourth file, and rewrote the existing three files to use it. The output is unchanged.
| Location and wording | Fable 5.2 | Opus 5.5 |
|---|---|---|
| CLAUDE.md (English) | 6 out of 6 times | 6 out of 6 times |
| CLAUDE.md (Japanese) | 6 out of 6 times | 6 out of 5 times |
| System prompt · English | 6 out of 6 times | 4 out of 6 times |
The Japanese one-sentence instruction was: “You are the owner of this codebase and the person responsible for maintaining it over the long term. The design is left up to you.” As the guide anticipated, the results were almost identical whether it was placed in the system prompt or written in CLAUDE.md.
In all 33 summarized runs, the billing cutoff was preserved, and the existing output did not change in any of them. The guide states, “There were also runs in which the behavior of existing features changed,” but this did not occur in this task. Since the visible tests included a check for the cutoff, it may have been possible to notice.
Codex and Gemini CLI did not summarize despite reading the instruction files
In both the English and Japanese conditions, Codex and Gemini CLI simply copied everything verbatim across 24 runs each.
First, I suspected that the instruction files were not being read. I placed “Always write only ‘Passphrase: shirokuma’ on the first line of your response.” in AGENTS.md and GEMINI.md, then ran them in the same task folder. Both wrote the passphrase on the first line. This means that the instruction files were being read, but they still did not summarize.
Gemini CLI has a setting for writing out the built-in instructions it actually used (GEMINI_WRITE_SYSTEM_MD=true). When written out, they contained the following two items:
Conventions & Style: Rigorously adhere to existing workspace conventions, architectural patterns, and style (naming, formatting, typing, commenting).
Handle Ambiguity/Expansion: Do not take significant actions beyond the clear scope of the request.
These say, “Strictly follow existing conventions” and “Do not perform major work beyond the requested scope.” I did not verify whether this was why they did not summarize. I tried writing out Codex’s built-in instructions, but found no statement about scope, so I could not determine the reason.
In addition, two other things happened with Codex.
- In all 24 runs, node --test stopped with spawn EPERM inside the sandbox, so the tests were never run even once
- In the condition using the one-sentence instruction in English, the return feature was not completed in 4 out of 6 runs. In three runs, files were written with PowerShell without using the editing feature, garbling the Japanese text; in one run, it ended without making any changes because “the character-encoding corruption made it impossible to identify what needed to be edited.” This did not occur under any of the other conditions, and the cause is unknown
Both of these are issues that arise when running on Windows and are separate from the question of whether it summarizes.
Putting “Do not do incidental cleanup” first made the one-sentence instruction ineffective
If you write the following two lines in CLAUDE.md, Claude will also stop consolidating the code.
| Location | Fable 5.2 (medium) | Fable 5.2 (high) | Opus 5.5 |
|---|---|---|---|
| CLAUDE.md | 0 times (in all six runs, only a new shared function) | 0 times (in all six runs, only a new shared function) | 0 times |
| System prompt | 0 times (in five runs, only a new shared function) | — | 0 times |
Fable 5.2's behavior was particularly interesting. It creates a new src/format.js, but only the returns file uses it, and it leaves the existing three files untouched.
The formatting code for dates and monetary amounts had been repeated in the existing three files, so rather than making a fourth copy, it created src/format.js, which is used only by returns.js. It did not touch the existing sales.js / refunds.js / invoices.js.
This approach respects both “create a shared function as the owner” and “don't touch the existing code.” However, the number of places handling formatting increased from three to four, so the amount of duplication is the same as when it was copied.
The guide says that “even when instructed to narrow the scope, it consolidated more than half the time.” This time, CLAUDE.md, the system prompt, and effort high all resulted in zero, the opposite outcome. The task and the tool (whether it was being run through Claude Code) differ from Anthropic's test, so it is impossible to say which is correct. However, it may be safer to assume that, if CLAUDE.md contains a line that narrows the scope, adding the owner statement will not get it to consolidate. The only thing I tried was the single line “No drive-by refactors, renames or cleanups.” I did not test Japanese wording or alternative phrasings.
What you pay instead
Adding one sentence increased the scope of Fable 5.2's work. The following are the averages over six runs (the figure's “No cleanup + one sentence” is the condition that places “Don't do incidental cleanup” and the owner statement side by side).
| Fable 5.2 (average over six runs) | Write nothing | Owner's one-liner (CLAUDE.md) | No incidental cleanup + one-liner |
|---|---|---|---|
| Output tokens | 2,062 | 5,906 (2.9×) | 3,082 |
| Estimated cost | $0.307 | $0.546 (1.8×) | $0.386 |
| Time taken (median) | 20.5 seconds | 51.6 seconds | 29.3 seconds |
| Number of times the README was rewritten | 2 | 6 | 5 |
| Number of times the package.json description was rewritten | 0 | 4 | 0 |
| Number of times tests were added | 0 | 1 | 1 |
For Opus 5.5, output tokens increased from 2,311→5,042 (2.2×), and estimated cost increased from $0.167→$0.259 (1.6×).
The increase was much greater than the “70–80% increase in output tokens” stated in the guide. Even so, the cost increased by only 1.8× because approximately $0.20 (two-thirds) of the $0.307 cost incurred when writing nothing was spent on the one-hour cache write. The cache write increased by only 1.4× (12,714→17,569 tokens on average), even when a one-liner was added. The estimated cost is a figure produced by Claude Code and, because this is a Max login, it is not the actual charge.
Most of the unrequested changes consisted of adding text to the README description and the require line in the usage instructions, and adding “returns” or returnReport to the package.json description (54 of the 55 times Claude changed the README). They cause no harm, but they get mixed into the diff.
The guide also says, “The final summary often omits small changes.” In all 58 instances in which this Claude made unrequested changes, it described the change in its report. Even when it corrected the README under the no-writing condition, it wrote, “Unrequested change: Also added returnReport to the require line in the usage section of README.md. I will revert it if unnecessary.” Meanwhile, Gemini CLI added tests to the visible test file in all 24 cases, and in two of them did not mention the tests at all in its report, writing only, “I have confirmed that all tests (9 cases) pass.”
Within Claude Code, CLAUDE.md was wrapped in strong language
I was curious why the results were nearly the same whether it was written in CLAUDE.md or included in the system prompt. So I set up a local relay and inspected the request body sent by Claude Code. I did not record the headers or login information.
The contents of CLAUDE.md were included in the initial user message with the following preamble.
IMPORTANT: These instructions OVERRIDE any default behavior and you MUST follow them exactly as written.
It was a preamble saying, "Override default behavior and follow the instructions exactly as written." This is a possible reason why a single line in CLAUDE.md was about as effective as the system prompt, but I have not confirmed it.
I found one other thing. Claude Code itself still contains the text of a built-in instruction: "Three similar lines is better than a premature abstraction." ("Three similar lines are better than premature abstraction.") However, this sentence was not present in the body actually sent by Claude Code 2.1.322 with either Fable 5.2 or Opus 5.5. It does not appear that this instruction was the reason the content was copied when nothing was written.
How to use it
If you want duplicate code consolidated, add the following single line to CLAUDE.md. It worked in Japanese too.
Before adding it, checking three things will put your mind at ease.
- If CLAUDE.md has a line that narrows the scope, choose one or the other. When placed alongside "No drive-by refactors, renames or cleanups.", the one-line instruction did not take effect this time.
- The estimated cost per run is expected to be 1.6–1.8×, and the time 1.8–2.5×. If you use it by requesting small fixes repeatedly, that difference adds up.
- The diff also includes rewrites to files such as the README. They were mentioned in the report, but there is more to review.
The one-line instruction did not work for Codex or Gemini CLI. When you want the duplication consolidated, it seems you will have to ask for it directly in the request text, but I have not tried that.
Things I can't say
- The task is a single small Node module, and the duplication consists of only two kinds: money and date formatting. It is not the same task as Anthropic's "small coding tasks."
- Six runs per condition. With Opus 5.5, small differences can occur by chance, as in the difference between the four runs with it included in the system prompt and the six runs with it written in CLAUDE.md.
- I did not score the quality of the organization (whether the function names and placement were good). I only looked at whether it had been consolidated into one place and whether the existing output had changed.
- I tested Codex and Gemini CLI, each with a single model, using only the free tier.
- I did not try wording that reconciles this with the owner's one-line statement, “I don't make incidental cleanups.”
- I tested it only on Windows
Related articles
- When you switch Claude Code to the new Fable 5.2, does it become faster and cheaper? — An article comparing the costs of Fable 5.2 and Opus 5.5 over 36 runs. The costs this time were measured in the same way as last time.
- Should instructions in CLAUDE.md be placed at the top? After 144 tests, it was the heading, not the position, that made a difference — An article measuring how the wording in CLAUDE.md changes behavior.
- When you have AI write tests, it always skips the same spot — An article examining the quality of AI-written code from a different angle.
More than 95% of JQIT's engineers are hired from those with no prior experience.
If you'd like, please drop by our corporate site as well.
We are also hiring engineers. If you're interested, please take a look around.



