A key study on the question has softened its conclusion since February. Here is what the evidence says now, and what is still worth putting in the file.
Open almost any active repository today and you will find a file that was not written for people. It might be called AGENTS.md or CLAUDE.md. It tells a coding agent how the project works, and most teams assume that having one makes the agent better.
This story was written with the assistance of an AI writing program. The figures come from the papers and documentation named in the text.
Three studies published this year tested that assumption. At first they seem to disagree. Once you look at what each one measured, they mostly don't, and together they suggest a much shorter file than the one many of us have.
The study that changed its mind
In February, researchers at ETH Zurich and LogicStar.ai published a paper with an uncomfortable finding. Context files, it said, "tend to reduce task success rates" and raise cost by more than 20%. The advice that followed was easy to remember: your AGENTS.md may be hurting you.
The paper has been revised twice since then. The current version, dated 29 September, says something milder: the files do "not generally improve task success rates." The cost finding is still there.
"Makes things worse" and "doesn't reliably make things better" are different claims. If you formed your opinion from the February version, it's worth updating.
Here are the numbers behind the new wording. The team tested four combinations of agent and model on 300 tasks from SWE-bench Lite. They also built a new set of 138 tasks from 12 Python repositories whose developers had already committed a context file.
- Files generated by AI changed the average success rate by about -0.5 points on the first set and about -2 points on the second.
- Files written by developers, which only the second set had, raised it by about 2.4 points.
None of those differences from having no file was statistically significant. On the second set, developer-written files did beat generated ones, by about four points on average. That difference was significant (p = 0.038), though each setup was run only once per task.
The cost increase is much clearer. Generated files raised the average cost by 20% on one set and 23% on the other. Developer-written files raised it by up to 19%.
The study that found agents got faster
A second paper, led by a researcher at Singapore Management University, seems to say the opposite. It ran OpenAI's Codex on 124 pull requests from 10 repositories, with and without the AGENTS.md file. With the file, median running time fell by 28.6% and median output tokens fell by 16.6%.
Those are real gains, but there are two catches.
The first is that the study didn't test whether the code was correct. The authors checked a sample of 50 tasks to confirm the changes were substantial and on topic, but they left correctness for future work. Finishing sooner only helps if the answer is right, and this study can't tell us that.
The second is that the tasks were small: at most 100 changed lines across five files. Output tokens fell, but the median number of input tokens was slightly higher with the file. So "fewer output tokens" doesn't automatically mean a smaller bill.
The study that asked why
The third paper, by independent researcher Prakhar Khatri, was presented at a research workshop in October. It is small, but it was designed to explain the disagreement. It covers 17 tasks from three repositories, with three attempts per setup, for 288 scored runs across Claude Code and Codex. Most tasks were scored with hidden tests. Four had no tests, so they were scored on how closely the change matched the real one.
Claude passed 53.3% of its runs with no context and 55.6% with the full file in its prompt. Codex passed 58.8% without context and 56.9% with it. In a separate check, Codex was left to find the file on its own, as it would in normal use. It passed 62.7% of its runs, which wasn't a significant difference either. That check ran three months later on a newer version of Codex, so the comparison isn't a clean one.
The paper is open about its limits. By its own estimate, even a 30-point difference would have been detected only 57% of the time, so it can't rule out a real effect. Its most useful contribution may be its look at why runs failed. Khatri examined four near-misses, where the agent failed only a few tests. In each one, the problem was the engineering itself, such as choosing the wrong pattern or wiring a check incorrectly. None came down to a missing fact that a context file could have supplied. Four cases can't settle the question, but they offer a plausible explanation.
One warning that changed what the agent did
One of Khatri's repositories, a compiler called opshin, had a useful warning in its file: the full test suite takes more than 20 minutes.
Without the file, Claude started the full suite an average of 3.67 times per run. With the whole file in its prompt, that fell to 2.44. When the same content was split into pages it could look up, it fell to 1.67. Running time was about 24% lower with context.
This is a clue, not proof. The timing covers five tasks and the test counts only four, one of which went slightly the other way. The differences weren't statistically significant, the analysis was done after the fact, and Codex showed no similar drop in running time. The pass rate didn't improve either. But the explanation makes sense. Reading the code won't easily tell you how slow the tests are. You usually find out by waiting for them.
The ETH Zurich study points the same way on following instructions. When a context file mentioned the Python tool uv, agents used it 1.6 times per task on average. When it wasn't mentioned, they used it fewer than 0.01 times.
So agents do tend to act on what's in the file. The question is whether what's in it is worth acting on.
The section you can probably cut
Many context files open with a tour of the project: what it does, how the folders are arranged, where things live. In the ETH Zurich set, eight of the 12 developer-written files had an overview.
It didn't give agents a useful head start. The researchers counted how many steps agents took to reach a file that the real fix had changed, and context files didn't meaningfully reduce that number. Agents can already list folders and search code, so the tour mostly repeats what they can find for themselves.
There is an important exception. When the researchers removed the rest of the documentation, including Markdown files, example code and the docs folder, generated files improved performance by 2.7% on average. (Claude Code was left out of that test because of cost.) If your project has almost no documentation, a generated file may fill a real gap. If it has a good README, the file may mostly be repeating it.
Why these files keep growing
A separate study of 2,303 context files from 1,925 repositories looked at how they change over time. In its first version, 67.4% of the CLAUDE.md files had been changed in more than one commit. The typical commit to one of those files added 57 words. For every type of file studied, the typical commit removed fewer than 15.
It's easy to see how that happens. The agent makes a mistake, someone adds a rule, and nobody goes back to check whether the rule is still needed. (That part is my reading. The study tracked the edits, not the reasons for them.)
The ETH Zurich team found no clear link between a file's length and its results, so a shorter file isn't automatically a better one. Still, every line needs a reason to be there. Anthropic's Claude Code documentation suggests keeping each CLAUDE.md under 200 lines and warns that longer files use more context and are followed less reliably.
A simple test for every line
Claude Code's best-practices guide suggests two questions. Could the agent find this by reading the code? Would it actually go and look? If both answers are yes, leave the line out.
Here is how I would apply that, along with the research.
Usually worth keeping:
- Commands that aren't obvious, such as how to run a single test
- Costs the code doesn't show, such as a 20-minute test suite
- Tools the agent wouldn't choose by default
- Conventions and decisions that aren't written down anywhere else
- Places where the code is misleading, such as a folder that looks active but isn't
Usually worth cutting:
- Folder-by-folder tours
- Anything already in the README
- General advice such as "write clean code"
- Rules your linter already enforces
- Rules added after a one-off mistake
Here is a short made-up example:
# Commands - One test file: uv run pytest path/to/test_file.py - The full suite takes 20+ minutes. Run only the tests you need. # Conventions - Use uv, not pip. - Store money as integer cents, never floats. # Watch out - legacy_api/ looks unused, but the mobile app still calls it. A new teammate could easily get any of those wrong, even after reading the code carefully.
If a rule can't be broken, don't rely on the file
Agents often follow these files, but nothing forces them to. Claude Code's documentation says CLAUDE.md is treated as context and isn't enforced.
If something must happen every time, or must never happen, put it somewhere that can enforce it. That could be a CI check, a permission rule, or a hook, which is a script that runs automatically at a set point in the agent's work. "Please don't edit the production config" is a request. Blocking the edit is a control.
Test your own file
These studies can't tell you whether your file works. Two of them used only Python projects, the models keep changing, and your project isn't in the data. But you can run a small version of the experiment yourself:
- Pick five to ten finished tasks that have good tests.
- For each one, start from the code as it was before the fix, with the finished solution and later Git history out of the agent's reach.
- Run each task several times with your current file, with a trimmed one, and with none. Keep the model and settings the same.
- Record whether the tests pass, how long each run takes, and what it costs.
A test this small won't settle a difference of a few points, and one lucky run proves nothing. It can still show you a large problem, such as a rule that sends the agent off to run a slow test suite every time. If the trimmed file does just as well for less money, keep the trimmed file.
The short version
The evidence doesn't show that a context file makes an agent better at solving problems. It does show that the file can change how the agent works, which can save time or add cost depending on what you wrote.
So don't use the file to explain your whole codebase. Use it for the things your codebase can't explain for itself.
Try opening yours today and asking those two questions about every line. How much of it would be left?
Originally published on Medium.

