The easy way to get an AGENTS.md or CLAUDE.md is to run your coding agent's setup command and let it read the repository and write the file. In a project with decent docs, we think that file is close to worthless. It mostly repeats what your docs already say, and the agent can read those. What your coding agent can't learn from your code is whatever isn't written anywhere it will look while working a ticket: the rule that lives in a senior engineer's head, or the one buried in a comment three files away. That's the part a setup command won't write.
Meta has the best examples we've seen. In April it wrote up what happened when it pointed AI agents at one of its large internal data pipelines.1 The agents "would guess, explore, guess again and often produce code that compiled but was subtly wrong." So Meta went looking for the rules behind the mistakes, and documented more than fifty that had never been written up before. Three of them:
- One pipeline stage outputs a temporary field name, and a later stage renames it. Use the wrong name and code generation fails without an error.
- Some enum values look deprecated but must never be removed, because serialization depends on them.
- Two configuration modes use different field names for the same operation. Swap them and you get wrong output, again with no error.
Read those as a new hire would. Each one looks like a cleanup opportunity. The deprecated-looking enum value is practically begging to be deleted. An agent that removed it would produce exactly what Meta describes, code that compiles and is subtly wrong. Someone on the team might catch it in review, if that someone happens to be the one person who knows.
The generated file is a copy of your README
The best test of this so far comes from ETH Zurich, whose study of AGENTS.md files was revised in September.2 They had each agent generate its own context file the usual way and ran it on real tasks. The generated files didn't make the agents any more successful, and they raised the cost by about a fifth.
The cost part is the interesting one. The agents weren't ignoring the files. They did what the files said: ran more tests, explored more, thought longer. Most generated files contained an overview of the repository, and the overviews didn't help the agents find the right code any faster. So you pay a fifth more for an agent that dutifully follows instructions that tell it nothing new.
Then the researchers ran the test that explains it. They deleted the repositories' documentation, the Markdown files, the examples and the docs folder, and ran three of the agents again with the same generated files. Now the generated files helped, and even beat the files the projects' own developers had written. Our reading is that a generated file is a summary of your docs. When the docs are there, it's a second copy the agent didn't need. When they're gone, it's the only copy left.
That run isn't fair to the developers' files, though. The docs were deleted after the generated files had soaked them up, and the developers didn't write theirs to replace the docs.
| Context file | Change in success vs no file | Change in cost |
|---|---|---|
| Generated, docs in place | −0.5% SWE-bench Lite, −2% CTXbench (neither significant) | +20%, +23% |
| Written by the developers, docs in place | +2.4% average on CTXbench (not significant) | up to +19% |
| Generated, docs deleted (three agents) | +2.7% average on CTXbench, ahead of the developers' files | not reported |
The authors land in the same place we do. A context file "should only contain specific additional instructions beyond what is already available in the codebase."
Meta's models were asked a different question
Meta's files were written by models too, by a swarm of more than fifty agents that read every file and were asked what breaks. One question was "What are the non-obvious patterns that cause build failures?" Another was "What tribal knowledge is buried in code comments?", and Meta says that one was "where the deepest learnings emerged."
Ask a model for an overview and you get an overview. Ask it what breaks, and what's hidden in the comments, and you might get the enum rule. Even then, Meta needed an army to get it. If your team has a senior engineer who has been around long enough, they probably know it already and could say it in a sentence.
A rule that outlives its code is worse than no rule
Meta's post has a line we'd put on the wall: "Context that decays is worse than no context at all." ETH's finding explains why. Agents do what the file says. Say a rule from 2023 describes a table that was split in 2025. The agent will follow the rule, confidently, into the old table.
Meta handles this with automated jobs that run every few weeks, check the file paths in its context files and fix stale references. An August study by Gao shows why something like that is needed.3 Rules kept as plain text noticed none of 50 cases where the code under them had changed. Rules tied to a fingerprint of the code they describe caught all 50, and left the unchanged ones alone. Text can't tell when the code under it moved. A rule has to know which code it's about.
Don't expect more correct code
We haven't found a study showing that context files make agents write more correct code on private codebases. Meta's only number on the agents' work measures effort, about 40% fewer tool calls and tokens per task, on six tasks. So don't write a context file expecting it to fix wrong code. Write it so the agent stops breaking the rules your team actually has, and stops burning tokens rediscovering them.
That limit is also why we'd say "write it yourself" and not "skip it". ETH tested on open-source Python projects, recent and fairly niche ones among them. We'd bet a ten-year-old private codebase has far more of these unwritten rules, though we know of no study that has measured it.
Write the warnings, not the overview
The problem we had ourselves was the same shape. On our team, the way people used AI varied from person to person, results depended on who was driving, and the good practice lived in a few people's heads. Cobble started as our fix, one repeatable process where those habits live instead. One thing we built because of it sits at the very start. When someone brings Cobble a request, the interview that shapes it checks it against the team's architecture decision records before any code is written. If the request conflicts with a decision, a person settles it from the app, either superseding the decision or keeping it with a note.
You don't need a tool to start, though. If your repository has decent docs, delete the generated file. If it has none, what the model wrote is a README, so commit it as one and keep AGENTS.md for the rules.
Then ask the engineer your team takes its questions to: what would you warn a new hire about? Write down each answer as the rule, the reason, what breaks if you ignore it, and the path it's about, so a script can tell when that path is gone. Put a date and a name on it. Meta's files ran 25 to 35 lines, and yours can be shorter. When the code a rule describes is gone, delete the rule.
- Ganeriwal, Rath and Verma, "How Meta used AI to map tribal knowledge in large-scale data pipelines", Meta Engineering, 6 April 2026. The swarm of 50+ agents, the critic agents' three rounds, the five questions asked of each module (two quoted here), the description of the files as "structured navigation guides", the 25 to 35 lines per file and the periodic validation jobs are all described in the post. The 40% fewer tool calls and tokens per task is from preliminary tests on six tasks. Meta also argues that the AGENTS.md research doesn't transfer to its codebase, because it was run on code models already know. Back to text
- Gloaguen, Mündler-Sasahara, Müller, Raychev and Vechev, "Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?", arXiv 2602.11988, v3 of 29 September 2026. Generated files changed success by −0.5% on SWE-bench Lite (300 tasks, 11 popular Python repositories) and −2% on CTXbench (138 tasks, 12 recent, fairly niche Python repositories), not statistically significant, and raised cost by 20% and 23%. Developer-written files raised success by 2.4% on average (also not significant) and cost by up to 19%. After deleting the documentation (Appendix B, Claude Code excluded for cost), generated files improved success by 2.7% on average and beat the developer-written files. The developer-written files were not written as a replacement for the docs. A split by training cutoff found "no significant or consistent difference". Back to text
- Gao, "Executable Code Knowledge", arXiv 2608.16295, 17 August 2026. 26 tasks in 3 repositories; rules bound to AST fingerprints flagged all 50 stale cases and none of 17 unchanged controls. Back to text
