✕ Beranda Langganan Per Project Proses Profil FAQ Co-Researcher Blog Carousel SaaS Hubungi
Artikel ini juga tersedia dalam Bahasa Indonesia. Baca versi Indonesia →

AGENTS.md Beats CLAUDE.md: The Cross-Vendor Context File Standard

AGENTS.md Beats CLAUDE.md: The Cross-Vendor Context File Standard

If you work with more than one coding agent, your repository has probably carried several instruction files at once: CLAUDE.md for Claude Code, .cursorrules for Cursor, .github/copilot-instructions.md for Copilot, GEMINI.md for Gemini, and so on. Their contents are nearly identical, yet each has to be maintained separately. The moment one gets updated and the others do not, different agents start working under different rules.

Marmelab's survey The State of AI Harness Engineering 2026 shows the ecosystem moving away from this mess. One of its section headings puts it bluntly: "AGENTS.md is winning." This article covers what the survey found, why long context files actually hurt, and how to write a file that genuinely shapes agent behavior.

From Vendor-Specific Files to One Standard

AGENTS.md is a plain Markdown file at the repository root containing instructions for any coding agent, not for one particular product. The idea is simple: one source of truth, read by every tool.

Marmelab analyzed 246 open-source repositories that describe themselves as harnesses (or large, popular repositories that contain one), and compared them against 145 large open-source projects outside the AI world such as Symfony, Rails, Django, React, and Kubernetes. Some of the relevant numbers:

Finding (Marmelab 2026 survey) Value
Repositories with an AGENTS.md at the root 189
Repositories with a CLAUDE.md 155
Repositories writing instructions for at least two agents 46%
Large non-AI projects shipping an agent instruction file 63%
CLAUDE.md files in large projects that are only a symlink/redirect to AGENTS.md 36 of 53

The last number is the most telling. According to Marmelab's 2026 survey, 36 of the 53 CLAUDE.md files in large open-source projects are just a symlink or a short redirect to AGENTS.md. In other words, roughly two thirds of the vendor-specific files in those projects no longer hold instructions of their own. They exist only because a particular tool looks for that filename, while the real content lives in AGENTS.md.

In real repositories the pattern usually looks like this:

# AGENTS.md holds the actual instructions
ln -s AGENTS.md CLAUDE.md

or a one-line CLAUDE.md that says "See AGENTS.md". It is a pragmatic approach: teams are not waiting for every vendor to agree, they simply make AGENTS.md the primary source and point everything else at it.

Why Long Context Files Lower Quality

The same survey notes that 57% of root instruction files are longer than 100 lines, with a median of 123 lines. Marmelab cites OpenAI's roughly 100 lines as a reference point. Many teams clearly write more than that, and the problem is not merely cosmetic.

Anthropic's article on context engineering explains the mechanism. Models have an "attention budget": every new token in context spends part of it, and the model's ability to accurately recall information decreases as the context grows (a phenomenon called context rot). Context must therefore be treated as a finite resource with diminishing returns. In Claude Code, CLAUDE.md is loaded into context up front, while other files are fetched on demand through glob and grep. So every line in a context file is paid for in every session, relevant or not.

Marmelab gathers several data points that reinforce this:

  • An ETH Zurich study on 138 real-world Python tasks found that machine-generated context files actually reduced success rates compared with no context at all, while adding more than 20% inference cost. Human-written files improved success by only about 4%. In both cases the agent used 14–22% more reasoning tokens.
  • OpenAI reported four failure modes of a single large instruction file: it crowds out the task, makes everything look equally important, goes stale quickly, and resists mechanical checks.

The end result is rules that technically "exist" but are practically never read. Important rules drown among dozens of others, and the agent has no way of knowing which ones are truly mandatory.

What Belongs in AGENTS.md

Anthropic's principle applies here: aim for the minimal set of information that fully describes the expected behavior, written at the right "altitude", specific enough to steer but not as brittle as hardcoded logic. In practice, that means the things an agent cannot infer from the code:

  1. Exact build and test commands. composer test, npm run build, how to run a single test, prerequisites that must be met first. This is the most valuable information because it is directly executable.
  2. Project conventions that are not obvious from the code. For example, "all upload limits are read from one config file" or "the code style deliberately departs from the default linter preset".
  3. Constraints that must never be broken. Things that cause real damage when violated: never run broadcasts in parallel, never use a particular column type in migrations, never delete a file that might be shared.
  4. Pointers, not payloads. Marmelab recommends a short root file that acts as a table of contents leading into a more detailed rule tree. This matches Anthropic's just-in-time context strategy: keep lightweight references (file paths) and let the agent load details when needed.

One habit Marmelab recommends is worth copying: add rules in response to agent failures that actually happened, not on speculation. Speculative rules are the main source of bloated files.

What Does Not Belong

Long architecture documentation. A study of 2,303 context files cited by Marmelab found architecture covered in 68.1% of them. But agents can read the code and the docs themselves. Copying a full architectural walkthrough into a context file means paying the token cost in every session for information that is mostly irrelevant to the task at hand. Keep it in a docs folder and link to it.

Security rules written as prose. This is the most worrying finding. An analysis of 481 public CLAUDE.md files, as reported by Marmelab, found only 4.4% of security rules backed by an actual control. A sentence like "never commit secrets" stops nothing. Marmelab recommends executable guards: hooks, linters, and scripts that also run in CI. If a rule is truly mandatory, enforce it with code, not with a paragraph.

Stale instructions. Marmelab suggests giving every control a recorded reason and an expiry condition, then pruning periodically. The awesome-harness-engineering list even notes a report that Anthropic removed about 80% of Claude Code's system prompt because accumulated instructions went stale as models improved.

A Healthy Skeleton

## Commands
- Install: composer install && npm install
- Test: composer test (run npm run build first)
- Single test: php artisan test --filter TestName

## Constraints
- Never edit a released migration; add a new one.
- WhatsApp broadcasts must never run in parallel.

## Further docs
- Blog flow: docs/BLOG_POST_FLOW.md
- Uploads: docs/UPLOADS.md

Short, executable, and every line has a reason to be there.

Conclusion

The convergence on AGENTS.md is not just about a filename. It signals that teams are starting to treat context files as part of the harness, a technical artifact that is maintained, tested, and pruned rather than a dumping ground for everything that comes to mind. Make AGENTS.md your primary source, point vendor-specific files at it, keep it short, and move truly mandatory rules into hooks or CI. Your agent will read less, but follow more.

References

Share Article