Platform Engineering
Context engineering: why a 300-line AGENTS.md does not help
An ETH Zurich study measures what repository context files actually do to coding agents: no gain in task success, over 20% more cost. What belongs in the file, and what has to leave it.
For a year now, one practice has spread almost without debate: put a context file at the root of the repository, AGENTS.md or a vendor equivalent, meant to explain the project to the coding agent. The files grow, filling up with conventions, history and advice. Nobody measures what they produce.
A study from the SRI lab at ETH Zurich, Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?, presented at the ICLR 2026 workshop on memory for agentic systems, did measure it. Its headline result: no gain in task success rates, and over 20% more inference cost.
What the study actually measured
The authors ran several agents on SWE-bench tasks with machine-generated context files, then on issues from repositories whose own developers had written such a file. The agents do respect the files: they read them, follow them and explore the repository more. But the effect on task success is neutral, slightly negative according to the write-ups, for more than 20% additional cost.
This is workshop work, on a limited set of agents and repositories. It is not a general law, and several commentators note that a short, human-written file may keep a small edge. It is enough, however, to strip the context file of its status as a self-evident good practice.
Why more context degrades the outcome
Three mechanisms add up, and they are familiar to anyone who has designed an information system.
- Diluted attention. Work on performance degradation as input tokens grow, popularised as context rot, describes a processing capacity that is not uniform across the window. Filling the window is not the same as informing the model.
- Contradictory instructions. A file accumulated over ten months holds rules written in different contexts. The agent applies them all at once.
- Stale instructions. A convention that was dropped but stayed written is worse than no convention at all: it points the agent at a state of the system that no longer exists.
What is worth writing
The test is simple: whatever a newcomer could not infer from an hour of reading the code, and whose absence causes an expensive mistake.
- The exact commands for build, test and verification, including the ones that must not be run.
- Non-negotiable invariants: what must never be changed without a decision, and why.
- Explicit prohibitions, with their reason. A prohibition without a motive gets worked around, by humans as much as by agents.
- Module boundaries: who is allowed to call what.
- Where to find the rest, meaning pointers into the documentation rather than the documentation itself.
What has to leave the file
Everything else, in particular project history, tutorials, full architecture descriptions and conventions the tooling already enforces. That material does not disappear: it moves behind a search or a tool, and the agent fetches it when it is useful. This is just-in-time retrieval, and tool vendors publish encouraging measurements for it. Cursor reports a 46.9% drop in total agent tokens by loading only tool names first and their details on demand. That figure comes from the vendor and has not been independently reproduced, but the direction is consistent with the ETH study: less imposed context, more chosen context.
The only way to settle it in your repository: measure
Published results depend on repositories, agents and models. The question is therefore not "should we have an AGENTS.md" but "what does mine change". The protocol takes half a day: twenty tasks representative of your repository, run with and without the file, and two columns recorded, outcome and cost. It is the same measurement discipline described for productivity in AI-assisted teams: without an eval set, you are comparing impressions.
What this says about architecture
A context file is a governance artefact wearing the clothes of a technical file. It carries decisions, prohibitions and boundaries, which is exactly the material of recorded architecture decisions. An invariant that exists only in an AGENTS.md will vanish at the next rewrite of that file; recorded as a decision, it outlives the file, and the file can then simply point to it. This is the same reasoning as in an architecture that is not rebuilt at every stage.
Sources
Related reading
Does this challenge sound familiar?
A first conversation to assess it together, at no cost.