Should documents have a separate section for AI agents?
More of what I write now has two readers. A design document goes to a colleague who decides whether to approve it, and then to a coding agent that implements it. The colleague needs the decision, the reasons, and the tradeoffs in a few minutes of reading. The agent needs file paths, commands, constraints, and a way to check its work, and it reads the whole text again on every run. I have been considering a convention for this: a human section and a separately labeled agent section in the same document.
This post checks that idea against the evidence published through November 2026, as a companion to my headless-access post, which argued for designing software interfaces for agents as well as people. The split already exists at the file level in software repositories, and documentation platforms already support it inside a page. The evidence contradicts one part of my starting assumption, that the agent section can be as long and detailed as it needs to be: longer inputs cost accuracy, and the best controlled study of agent context files found that they did not generally raise task success. I end with the format I plan to use, counts from my own repositories, and the experiment that would test the format.
The split already exists at the file level
AGENTS.md is a Markdown file at the root of a repository that coding agents read before they start work. Its site calls it “a README for agents” and states the division directly: “README.md files are for humans: quick starts, project descriptions, and contribution guidelines” (agents.md). The site reports use in more than 60,000 open-source projects, and the format is now stewarded by the Agentic AI Foundation under the Linux Foundation. Large repositories can nest the files, and “the closest AGENTS.md to the edited file wins.”
The tools that read these files also cap them. OpenAI’s Codex concatenates AGENTS.md files from the repository root down to the working directory, so files closer to the work override earlier guidance, and it stops adding files once the combined size reaches 32 KiB by default (Codex documentation). Anthropic’s Claude Code documentation sets a tighter target: “target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence” (Claude Code memory documentation). The same page notes that Claude Code strips block-level HTML comments from CLAUDE.md before the model sees them, which lets a maintainer leave notes for people inside an agent file without spending tokens.
Agent Skills extend the idea to loading on demand. In Anthropic’s design the agent loads each skill’s name and description at startup, reads the full SKILL.md file only when a task calls for it, and opens bundled files only as needed. The announcement calls progressive disclosure “the core design principle” (Anthropic, October 2025), the format is now an open standard that Codex also supports, and Codex caps its skill list at 2% of the context window. An OpenAI post from September 2026 gives matching advice for instruction files: “make the root document a minimal router that points to supporting docs and scripts” (OpenAI, “Rethinking skills and prompts for GPT-6 Astra”).
Documentation platforms support the split inside a single page. Mintlify’s <Visibility> component
hides agent content on the rendered site and includes it in the Markdown served to agents
(Mintlify), and Fern’s <llms-only> tag serves
“different content to AI agents and human readers from the same page”
(Fern). The mechanism I was
considering therefore exists already. What these tools leave open is what belongs in each section of
a design document or decision record, and none of the vendor documentation I read addresses it.
Longer context costs accuracy
My starting assumption was that the agent section could be as verbose as it needed to be, since an agent does not get bored. Three lines of published evidence contradict that assumption. Liu et al. found that models use information best when it sits at the beginning or end of a long input, and that accuracy “significantly degrades when models must access relevant information in the middle” (Lost in the Middle, TACL, 2024). Chroma tested 18 models, including GPT-4.1, Claude 4, Gemini 2.5, and Qwen3, and found that performance “varies significantly as input length changes, even on simple tasks” (Context Rot, 2025), in a vendor report that was not peer-reviewed.
The third result separates the effect of length from distraction. Du et al. replaced the irrelevant text in long inputs with whitespace, and in a second condition masked it so the model attended only to the relevant tokens. Across five models on math, question-answering, and coding tasks, accuracy still fell by 13.9% to 85% as input length grew (Du et al., Findings of EMNLP 2025). The relevant information was fully retrievable in every condition, so the loss came from length alone.
Guidance from the model vendors has reached the same conclusion. Anthropic’s guide to context engineering defines the goal as “the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome,” and it places good instructions between “hardcoding complex, brittle logic” and “vague, high-level guidance” (Anthropic, September 2025). The agent section should therefore be complete about the task and selective about everything else.
Do AGENTS.md files help coding agents?
The best controlled test of agent context files is a preprint from ETH Zurich, the Swiss Federal Institute of Technology (Gloaguen et al., arXiv:2602.11988). The authors ran Claude Code with Sonnet 4.5, Codex with GPT-5.2 and GPT-5.1-mini, and Qwen Code with Qwen3-30B-coder on SWE-bench Lite and on 138 tasks from 12 Python repositories that ship developer-written context files; the benchmark is called AGENTbench in the first version of the paper and CTXbench in the third. Context files generated by a large language model (LLM) changed task success by −0.5% on SWE-bench Lite and −2% on the repository tasks. Developer-written files raised success by 2.4 percentage points, which was not statistically significant (p = 0.21) in the September 2026 version. Both kinds of file raised inference cost by more than 20% on average.
The abstract states the conclusion plainly: “providing context files does not generally improve task success rates.” The authors also report that repository overviews “are not helpful,” which matches the advice above to leave out what an agent can learn by reading the code. The study covers coding tasks in Python repositories with four agent configurations, and it does not test documents such as design reviews.
Studies of real files show what developers write and how rarely they revise it. Across 2,303 agent context files from 1,925 repositories, 75.9% described test procedures, 70.8% implementation details, and 68.1% architecture, while 14.8% covered security and 14.5% performance (Chatlatanagulchai et al., arXiv:2511.12884). A study of 466 projects found “no established content structure yet,” and of the 155 files it tracked over time, 50% never changed after creation and another 23% changed once (Mohsenimofidi et al., MSR 2026). A file that stays fixed while the code changes turns into a source of wrong instructions.
Coding agents read these files more than any other kind of documentation, according to a preprint that classified 3,033 documentation interactions from 557 coding-agent sessions. Agent instruction files and agents’ own working notes made up 60.5% of the interactions, against 10.6% for conventional documentation and 1.3% for application programming interface (API) references (Gao and Chen, arXiv:2608.20195). The working-notes category was labeled by an LLM without human checks, and the combined share falls to about 55% after the authors’ reweighting. Combined with the ETH result, this means agents spend much of their documentation reading on files whose measured benefit to task success is small.
How the two readers differ
The evidence above moves the difference between the readers away from length. A person reading a design document has to decide something: approve it, fund it, or object to it. An agent working from the same document has to carry something out: change files, run commands, and check results. The person brings context from meetings, past projects, and the organization, while the agent starts each session with only what it is given and re-reads that text on every run, paying for each token each time.
The agent still benefits from the reasons behind each instruction. Anthropic’s prompting guide recommends explaining the motivation behind an instruction because it “can give Claude more information about your goals and help it deliver more targeted responses,” and its example replaces a bare “NEVER use ellipses” with a version that explains the output will be read by a text-to-speech engine (Claude prompting best practices). The same guide’s test for clarity is to show a prompt to a colleague with minimal context on the task: “If they’d be confused, Claude will be too.” An agent section stripped of its rationale to save tokens loses information the model uses on cases the instructions do not list.
Prompt format changes accuracy, and no format wins everywhere. Changing only the formatting of a prompt moved accuracy by up to 76 percentage points for LLaMA-2-13B on some tasks (Sclar et al., ICLR 2024), and a preprint found swings of up to 40% for GPT-3.5-turbo across plain-text, Markdown, JSON, and YAML templates on a code-translation task (He et al., arXiv:2411.10541). He et al. found GPT-4 more stable than GPT-3.5-turbo, and neither paper found one format best across models and tasks. I use headings and lists in agent sections because they help me maintain the file, without evidence that they help the model more than clear prose would.
A label helps only if something loads it
A section marked for agents does nothing unless the agent’s harness, the software that runs the model and its tools, loads it. The llms.txt proposal shows what happens without that loading step. In September 2024 Jeremy Howard proposed “adding a /llms.txt markdown file to websites to provide LLM-friendly content” (llmstxt.org). An Ahrefs study of 137,210 domains found that 28% had a valid llms.txt and that 97% of those files received zero requests in May 2026, with coding agents such as Claude Code fetching the file more often than AI search bots did (Ahrefs, June 2026). Ahrefs notes that a fetch does not show the content was used.
AGENTS.md and CLAUDE.md reach the model by a different route: the agent loads them automatically at startup. An agent appendix inside a design document reaches the model only if a person or a tool hands the document to the agent. The convention therefore needs a pointer from a file the harness already loads, such as a line in AGENTS.md that names the design documents and says when to read them.
What I recommend
The format I plan to use keeps the human brief first and short, and puts a labeled agent appendix after it. The appendix holds what an agent cannot learn from the code: scope, constraints, commands, how to verify the work, what counts as done, and links to the authoritative sources. It links to facts instead of copying them, so each fact has one source of truth, and the agent reads the human brief too, since the brief carries the reasoning. Here is a compact version for a hypothetical caching decision:
---
status: approved
owner: platform team
last_verified: 2026-11-14
---
# Cache reference data for 24 hours
## Decision
Cache low-volatility reference tables for 24 hours to cut repeated
database reads. Rollback is a config change.
## Why
Most reads on these tables repeat queries for data that changes
about once a week.
## Tradeoffs and open questions
Users may see data up to 24 hours old. Open: does any table change
more often than daily?
---
## Agent appendix
Audience: coding agents. This section grants no permissions.
- Scope: tables tagged `reference` in `config/data_classes.yaml`.
- Constraints: never cache tables tagged `sensitive`; keep the
uncached fallback path.
- Commands: `make test`, `make test-cache`.
- Done when: cache-hit, expiry, and fallback tests pass and
`ops/checks/freshness.py` reports no violations.
- Out of scope: deploys, production config, other tables.
- Source of truth: `config/cache.yaml` and the Decision section above.
An agent appendix is input to the model, and it grants nothing. If people outside the team can edit a document, or an agent retrieves it from a shared drive, its agent section is untrusted content in the sense the Open Worldwide Application Security Project (OWASP) uses in its Top 10 for LLM applications. That guidance says to “separate and clearly denote untrusted content,” to handle privileged functions “in code rather than providing them to the model,” and to add “human-in-the-loop controls for privileged operations” (OWASP LLM01:2025). The “Out of scope” line in the template is a reminder for a cooperative agent, and the harness’s permission settings are what stop an agent from deploying.
I would not add an agent appendix to every document. Status updates and meeting notes need only the human part. Repository-wide conventions belong in AGENTS.md or CLAUDE.md, which tools load automatically, and repeatable procedures belong in a skill or a script with a test. The appendix fits documents that a person approves and an agent then implements, such as design documents and decision records.
What my own repositories show
I already split by file in most of my public work. Of the 26 public repositories linked from this site, all 26 have a README, 21 have a CLAUDE.md, and 2 also have an AGENTS.md, counted through the GitHub API on November 14, 2026. The CLAUDE.md files run from 19 to 312 lines with a median of 106, against a median of 182 lines for the README in the same 21 repositories. Two of the 21 exceed Anthropic’s 200-line target, and 3 are longer than their README.
Keeping the files current is the weaker part of my practice. Four of the 21 CLAUDE.md files have a single commit, and 10 had no commit after the day they were created. In 5 of those 10 repositories the code also stopped changing that day. In the other 5, between 1 and 7 later commits landed without a change to CLAUDE.md, and I have not yet checked whether any of those commits made the file wrong.
An agent generated these CLAUDE.md files with Claude Code’s /init command. The ETH study produced its LLM-written files the same way, with “the recommended initialization command and model for each agent individually” (Gloaguen et al.), and that condition changed task success by −0.5% and −2% while raising inference cost by about 20% and 23%. By that result, my CLAUDE.md files add cost to every agent run without a measured gain in task success. The study covered Python repositories and four agent configurations, so the effect in my own repositories is still unmeasured.
Where this argument is weakest
No controlled study has tested a human section and an agent section in one document against the alternatives, so the format above is a hypothesis. The strongest counterargument is that a good README already serves both readers. One Hacker News commenter put it as “Everything in the AGENTS.md file should just be in a good README.md file” (Hacker News, August 2025), and the ETH finding that developer-written files barely helped is consistent with that view. Models and harnesses also differ in how they load and weigh instructions, so a format tuned for one agent may not transfer to another. Every added section is one more thing to keep current, and my own commit counts above include files left untouched while the code around them changed.
The experiment I plan to run
The test gives the same agent the same tasks with three versions of the same information: the human document alone, the document with an agent appendix, and the document plus a separate AGENTS.md-style file the harness loads automatically. For each run I would score task success, constraint violations, unsupported assumptions, and tokens consumed. The tasks would come from my engineering repositories, where I already record agent runs as run bundles. Three attempts per arm cannot reach p < 0.05 with Fisher’s exact test even on a perfect split, as the run-count post showed, so the experiment needs more than that per task.
The short version
The split between README and AGENTS.md already exists in more than 60,000 projects, and documentation platforms support agent-only sections inside a page. Longer inputs cost accuracy: input length alone cut accuracy by 13.9% to 85% across five models. LLM-written context files changed task success by −0.5% and −2% on two benchmarks, developer-written files gained 2.4 points that were not statistically significant, and both raised inference cost by more than 20%. Half of the agent files tracked in one study never changed after creation. My 21 CLAUDE.md files were all generated with /init, the method behind the study’s LLM-written condition, and 10 of them had no commit after their first day. For documents an agent will implement, I plan to write a short human brief and a hand-written agent appendix, point to it from a file the harness loads, and keep permissions in the harness. The companion post covers the human half, including why I write the argument in the brief myself.
This is an independent analysis I did on my own time, using the public sources cited above and my own public repositories. The views are my own and do not represent any current or former employer.
Frequently asked questions
What is the difference between README.md and AGENTS.md?
README.md is written for people: what the project is, how to start, and how to contribute. AGENTS.md is described by its maintainers as 'a README for agents', a file coding agents load automatically that holds build and test commands, conventions, and constraints. The format's site reports use in more than 60,000 open-source projects.
How long should a CLAUDE.md or AGENTS.md file be?
Anthropic's Claude Code documentation targets under 200 lines per CLAUDE.md file because longer files consume context and reduce adherence, and OpenAI's Codex stops loading AGENTS.md content past 32 KiB by default. In an ETH Zurich preprint, context files raised inference cost by over 20% on average without generally improving task success.
Do LLMs perform better with more context?
Not reliably. In a Findings of EMNLP 2025 paper, accuracy fell by 13.9% to 85% as input length grew across five models, even when the irrelevant text was replaced with whitespace. Models also use information in the middle of a long input less well than information at the start or end.
Do AI crawlers read llms.txt files?
Rarely, as of 2026. Ahrefs found that 97% of valid llms.txt files across 137,210 domains received zero requests in May 2026, although coding agents fetched the files more often than AI search bots did.
More in AI agents
- Make headless access a first-class interface · 2026-11-12
- Before you build an agent, benchmark the simple version · 2026-09-29
- MCP transport is a lifecycle decision · 2026-08-27