CLAUDE.md file tested: 12 runs gained nothing from it, until it held rules the code hides
- The test: the same small coding job given to Claude Haiku agents three ways: no CLAUDE.md file, an auto-written one, and a hand-written one. Round 1 used rules you can see in the code. Round 2 added 3 rules that exist only in the hand-written file. 18 runs, scored by a hidden grader.
- The result: in round 1, all 12 runs scored full marks, with or without a file. In round 2, no file and the auto-written file both scored 7 of 10 checks. The hand-written file scored 10 of 10. It cost about 5% more tokens.
- The advice: do not write a CLAUDE.md that repeats what the code already says. Put in it only what the agent cannot see: business rules, limits, and "never touch this" files.
On 4 December the ClaudeDevs account on X (about 5,500 likes) announced that the Claude Code desktop app can now draft your CLAUDE.md for you, and lets you edit it in the app. That raises a plain question. What is a CLAUDE.md file worth? Does an agent do better with one, and does it matter if Claude wrote it?
I could not test the desktop app itself. So I tested the idea behind it on my own Mac, with a small project and a hidden grader.
Does a CLAUDE.md file really help Claude Code? How did I test it?
I wrote the project, the tasks and the grader before the first run.
- The project: "ledgerkit", a tiny Python ledger with 6 files. It has real habits a new developer has to learn. Money is whole cents. New features must be added to a
REGISTRYdict. Errors have codes that are listed indocs/errors.md. Every change writes an audit record. A file calledledger/legacy.pysays "Do not edit".run_checks.pymust pass. - Three setups: A, no CLAUDE.md. B, an auto-written CLAUDE.md. I asked one fresh Haiku agent to read the project and write one, using the same kind of request as Claude Code's /init command. It is not the real /init, which I did not run. C, a hand-written CLAUDE.md of 9 short rules.
- The agents: 18 fresh Claude Haiku subagents, one per run, each in its own copy of the project. Every prompt said the same thing: "If the project has a CLAUDE.md file, read it first."
- Round 1, two tasks: add a refund feature, and add a monthly summary. Every rule these need can be found by reading the code. Two runs per task and setup: 12 runs.
- Round 2, one task: the same refund task, but finance has three rules that appear nowhere in the code. Refunds are stored in
ledger["refunds"]with fixed keys. A refund above 50,000 cents needs anapproval_id. The audit action is exactly"refund". Only the hand-written file for round 2 lists them. Two runs per setup: 6 runs. - The scoring: a hidden grader. It checks that
run_checks.pypasses, thatlegacy.pyis untouched, that the feature is registered, that a new error has a new code listed in the docs, that a test was added, and that the behaviour is right. Round 2 adds 4 checks for the three finance rules.
What happened in round 1, when the code showed every rule?
Nothing changed. All 12 runs scored full marks: 13 of 13 checks on the refund task and 9 of 9 on the monthly summary, with no file, the auto-written file and the hand-written file alike.
The agents did not need the file. They read the code, saw the REGISTRY comment, the error table and the audit helper, and copied the pattern. One agent with no file wrote that the folder had no CLAUDE.md, so it followed the README and run_checks.py instead.
The tokens were almost the same too. Each run reported about 60,000 to 64,000 tokens. The average was 61,500 with no file, 61,900 with the auto-written file and 62,300 with the hand-written one.
What happened in round 2, with rules the code could not show?
| Setup | Checks passed (2 runs) | Finance rules followed (of 4) | Tokens per run |
|---|---|---|---|
| A: no CLAUDE.md | 7 of 10, 7 of 10 | 1 | 61,700 |
| B: auto-written CLAUDE.md | 7 of 10, 7 of 10 | 1 | 63,100 |
| C: hand-written CLAUDE.md with the 3 rules | 10 of 10, 10 of 10 | 4 | 64,500 |
The one finance rule that A and B met was the audit action name, and they met it by luck, because "refund" is the obvious word. They missed the other three: where to store refunds, the approval limit, and the error when approval is missing. The hand-written file got all of them, in both runs. It cost about 5% more tokens than no file.
This result is close to true by design. A rule that exists nowhere in the code cannot be followed by an agent that is not told it. But that is the point of the test. It shows where a CLAUDE.md earns its place.
Is an auto-written CLAUDE.md worth keeping?
It was accurate. I read it, and I found nothing invented. It listed the commands, described the data model, the audit trail, the error codes, the registry and the "do not edit" file. It was good at writing down what the code already shows. It also ran to about 400 words, against about 120 for my first hand-written rules.
But in my test it added nothing the agents could not find alone. And it could not add the one thing that matters: the rules in people's heads. Nobody can rebuild those from files. An auto-written draft is a fine start. The value is in what you add by hand.
What does this test not show?
- The project is tiny. Six files are easy to read in full. In a large codebase, a short map of where things are could save real time, and that is the case my test cannot see.
- The file was read on request. My prompt told each agent to read CLAUDE.md first. Claude Code normally loads the file by itself. I tested what the file contains, not how it is loaded.
- The auto-written file is a stand-in. A Haiku agent wrote it from an /init-style request. The real /init command, or the new desktop app feature, may write something different.
- Round 2 was built to make the file matter. I chose rules that the code hides. That shows a file can carry hidden rules, not that real projects have many.
- One small model and 2 runs per setup. A bigger model may find more on its own. Two runs show a pattern, not a rate.
- I fixed my grader once. A "returns whole numbers" check wrongly counted a month label as a number, so it failed 4 of the 6 round 1 summary runs. I also dropped 3 checks about a new error code for a bad month, because the task never asked for bad-month handling and all 6 runs failed them the same way. I made both changes before round 2 and regraded every round 1 run with the same rules.
- An AI helped build the test. I wrote the project, the tasks and the grader with an AI assistant's help, and checked each number by running the grader myself.
What should you put in a CLAUDE.md file?
- Business rules. Limits, approvals, and naming that comes from a decision and not from the code.
- Files and folders that are off limits. "Never edit this" is cheap to write and costly to learn the hard way.
- The check command. The one command that must pass before the agent says it is done.
- Skip what the code says. If a rule is visible in a comment or in three places in the code, the agent will find it. You pay tokens for every line you add.
- Test your own file. Give an agent a task with one hidden rule, with and without the file. If the result is the same, the line is not earning its place.
For a related look at what extra setup costs, see my single agent vs multi agent test, and the test of whether Claude Code stays inside the change you ask for.
FAQ
What is a CLAUDE.md file?
It is a plain text file in a project that Claude Code reads for instructions: how to run checks, how the project is laid out, and rules to follow. You can also keep one in your home folder for rules that apply to every project.
Does a CLAUDE.md file help Claude Code?
It depends on what is in it. In my test, a file that repeated what the code already showed made no difference: 12 of 12 runs scored full marks without one. A file with 3 rules that were not in the code raised the score from 7 to 10 checks out of 10.
What should I put in a CLAUDE.md file?
Put in what the agent cannot see: business rules, approval limits, off-limits files and the command that must pass before work is done. Leave out descriptions of code that the agent can read in seconds.
Should I let Claude write my CLAUDE.md?
As a first draft, yes. The draft in my test was accurate and had no invented facts. But it only restated the code. Add the rules that live in your head, and cut anything an agent would find by itself.
Does a longer CLAUDE.md cost more tokens?
A little. Runs with the hand-written file used about 5% more tokens than runs with none. Every line is read on every run, so keep the file short.
Sources
- ClaudeDevs on X, 4 December 2026: post about Claude Code desktop app updates, including a drafted CLAUDE.md (about 5,500 likes).
- Claude Code docs: How Claude remembers your project (CLAUDE.md files and where they are loaded from).
- Claude Code docs: Subagents (each runs in its own context window, and you can set the model per subagent).