<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Agents' Codex</title><link>https://agentscodex.com/tags/ai-agent-standards/</link><description>Practical, no-hype insights on AI agents — cost optimization, multi-agent architecture, and real-world operations.</description><generator>Hugo -- 0.162.1</generator><language>en-us</language><lastBuildDate>Mon, 01 Jun 2026 08:46:08 -0300</lastBuildDate><atom:link href="https://agentscodex.com/tags/ai-agent-standards/index.xml" rel="self" type="application/rss+xml"/><item><title>AGENTS.md: Self-Describing Repositories for AI Agents</title><link>https://agentscodex.com/posts/2026-05-22-agents-md-self-describing-repositories/</link><pubDate>Fri, 22 May 2026 06:00:00 -0300</pubDate><author>Agents' Codex</author><guid>https://agentscodex.com/posts/2026-05-22-agents-md-self-describing-repositories/</guid><category>agentsmd</category><category>agentconfiguration</category><category>selfdescribingrepos</category><category>aiagentstandards</category><description>AGENTS.md is the de facto standard for repo agent config, adopted by 60,000+ repos. Learn the hierarchy, why it beats skills by 21 points, and how to govern it.</description><content:encoded><![CDATA[<p><strong>TL;DR</strong></p>
<ul>
<li>AGENTS.md has been adopted by over 60,000 GitHub repositories as of March 2026; it&rsquo;s the closest thing to an agent configuration standard we have [8].</li>
<li>Vercel&rsquo;s internal evals showed AGENTS.md with a compressed docs index hit 100% pass rate on framework tasks versus 79% for skills. Passive context beats active retrieval [3].</li>
<li>AGENTS.md is instructions, not documentation. GitHub Well-Architected recommends CODEOWNERS and branch rulesets to protect it [5].</li>
</ul>
<p>A new developer joins your team: they spend the first week reading docs, pairing with colleagues, absorbing tribal knowledge. An AI agent dropped into your repository gets none of that: no onboarding chat; no pairing session; no context at all. It guesses, and when it guesses wrong about your monorepo&rsquo;s build system, the cleanup can consume an afternoon. AGENTS.md changes the economics of agent-assisted development by turning your repository into something agents can read. Not a README for humans: it&rsquo;s an instruction set for tools. The format is now stewarded by the Agentic AI Foundation under the Linux Foundation, adopted by over 60,000 repos [8]. The real shift isn&rsquo;t the file format. It&rsquo;s the architectural decision to treat your codebase as an agent&rsquo;s working environment, not just a file tree.</p>
<h2 id="the-problem-environmental-ambiguity-kills-agent-reliability">The Problem: Environmental Ambiguity Kills Agent Reliability</h2>
<p>Most production repositories are hostile environments for AI agents. Build commands live in Makefiles with no explanation of why. Testing conventions exist in someone&rsquo;s head. The thing you never push to production on a Friday; that&rsquo;s a Slack thread from 2023, not a doc. Human developers navigate this ambiguity through institutional knowledge; agents don&rsquo;t have any [2].</p>
<p>The result is predictable failure modes. An agent runs the wrong test command and reports a passing suite. It generates code against a deprecated internal API because the migration notice exists only in a team channel. These aren&rsquo;t model failures: they&rsquo;re environmental failures. The model was competent; it just didn&rsquo;t know the rules of your house.</p>
<p>Before AGENTS.md, every coding tool solved this differently: Copilot had .github/copilot-instructions.md; Cursor used .cursorrules; Claude Code invented CLAUDE.md. Each file, each format, each tool. The proliferation made the problem worse, not better; teams maintaining three copies of the same build instructions in three different formats just to keep their toolchain working.</p>
<div class="alert alert-alert">
  <p class="alert-heading">ALERT</p>
  <p>The fragmentation isn&rsquo;t just annoying; it creates silent failures. When one tool reads .cursorrules and another ignores it, agents produce different outputs from the same prompt. Your team can&rsquo;t debug what it can&rsquo;t reproduce.</p>
</div><h2 id="how-the-configuration-hierarchy-actually-works">How the Configuration Hierarchy Actually Works</h2>
<p>AGENTS.md isn&rsquo;t a single file. It&rsquo;s a hierarchy. Agents automatically read nested AGENTS.md files when operating inside those directories. Context scales from general to specific. The root AGENTS.md defines global conventions: language version, CI expectations, code review policy. A module-level file adds that module&rsquo;s invariants. A feature-level file captures edge cases the team discovered the hard way [2].</p>
<p>The mechanism is concatenation, not inheritance. A monorepo root might specify &lsquo;all services use Python 3.12 and pytest.&rsquo; A services/payments/AGENTS.md adds &rsquo;this service requires Docker Compose for integration tests, and the test database uses PostGIS.&rsquo; The agent sees both; the more specific instruction comes later in the prompt buffer, so it carries more weight in the model&rsquo;s attention.</p>
<pre class="mermaid">graph TD
  A[Repo Root AGENTS.md] --> B[Subdir AGENTS.md]
  B --> C[Working Dir AGENTS.md]
  C --> D[Most Specific Context]
  style A fill:#f9f,stroke:#333
  style B fill:#bbf,stroke:#333
  style C fill:#bfb,stroke:#333
  style D fill:#ffb,stroke:#333</pre><p>The hierarchy forces a natural prioritization: root handles global conventions; leaves handle local invariants. If something doesn&rsquo;t fit at the level you&rsquo;re writing it, you&rsquo;re probably writing it at the wrong level. An agent working in src/payments/refunds/ automatically picks up root → payments → refunds instructions, in that order. Nobody has to remember to reference the right file; the filesystem position does the routing [2].</p>
<p>Harness describes this as a three-tier structure: root defines global conventions, module-level files define local invariants, and feature-level files encode edge-case constraints [2]. The beauty of this model is that it maps directly to how teams already organize code. You don&rsquo;t need to invent a new taxonomy. Your directory tree is the taxonomy.</p>
<div class="key-takeaway">
  <span class="key-takeaway-label">Key Takeaway</span>
  The hierarchy is concatenation, not inheritance. Closer files override by appearing later in the prompt. Order is your only control lever.
</div>

<h2 id="why-88-agentsmd-files-scale-better-than-one">Why 88 AGENTS.md Files Scale Better Than One</h2>
<p>OpenAI&rsquo;s own monorepo uses 88 AGENTS.md files: one at root, the rest nested inside individual packages and services [2]. That number sounds extreme until you try the alternative: maintaining a single 5,000-line file that mixes SQL migration rules, frontend linting conventions, and deployment procedures into an unreadable blob.</p>
<p>The hierarchical pattern maps naturally to how teams actually work. The root AGENTS.md defines global conventions. A service-level file encodes that service&rsquo;s invariants; a feature-level file captures edge cases the team discovered the hard way. &lsquo;The CSV parser assumes UTF-8-BOM; don&rsquo;t switch to plain UTF-8 without updating the importer&rsquo; [2]. This is institutional memory, committed where tools can read it.</p>
<p>Large organizations with monorepos face the same scaling problem regardless of which AI coding tool they use. The hierarchical approach means contributors who work exclusively in one module only need to know that module&rsquo;s rules; the context system handles the rest automatically.</p>
<p>You don&rsquo;t curate what the agent sees; the file tree curates it for you.</p>
<h2 id="agentsmd-outperforms-skills-by-21-points-heres-why">AGENTS.md Outperforms Skills by 21 Points: Here&rsquo;s Why</h2>
<p>Vercel&rsquo;s engineering team ran a controlled evaluation comparing AGENTS.md against SKILL.md for Next.js 16 API tasks. AGENTS.md with a compressed docs index hit a 100% pass rate; skills with explicit instructions reached 79%. The gap: 21 points [3].</p>
<p>The root cause isn&rsquo;t model quality: it&rsquo;s retrieval reliability. Skills require a decision point: the agent must recognize a task matches a skill description, then invoke the skill. In Vercel&rsquo;s evaluation, 56% of cases never triggered the available skill; the agent simply didn&rsquo;t realize it was looking at a Next.js API task [3]. Passive context (always in the prompt, never requiring a retrieval decision) sidesteps this failure mode entirely.</p>
<p>Vercel&rsquo;s 100% vs. 79% results come from Next.js 16 API tasks specifically.</p>
<p>Whether the same gap holds for your framework, your evaluation criteria, and your coding assistant; nobody has published that data. The Next.js codemod team optimized their AGENTS.md for a known task distribution, which almost certainly inflates the numbers relative to a general-purpose setup.</p>
<p>Compression matters. Vercel&rsquo;s team packed a 40KB documentation index into 8KB using a pipe-delimited structure — an 80% reduction that preserved the 100% pass rate [3]. The technique matters because context windows are finite; bloated instructions compete with the actual code the agent needs to work on. The pipe-delimited format trades readability for density, and in this case, the trade paid off.</p>
<h2 id="claudemd-skillmd-and-the-multi-tool-reality">CLAUDE.md, SKILL.md, and the Multi-Tool Reality</h2>
<p>AGENTS.md is winning the standardization war, but it hasn&rsquo;t won it yet. Claude Code uses CLAUDE.md as its native configuration file; it doesn&rsquo;t read AGENTS.md directly, though you can symlink or reference it [6]. Different filename; different conventions; same goal.</p>
<p>SKILL.md occupies a different design point: where AGENTS.md is always-on, SKILL.md is on-demand (loaded only when the agent&rsquo;s task matches a skill description). The idea is efficiency: don&rsquo;t waste context window on instructions that don&rsquo;t apply. In practice, the trigger reliability problem makes this theoretical efficiency hard to realize [7].</p>
<table>
	<thead>
			<tr>
					<th>Configuration Layer</th>
					<th>File</th>
					<th>Load Trigger</th>
					<th>Best For</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>Always-active instructions</td>
					<td>AGENTS.md / CLAUDE.md</td>
					<td>Every request, unconditionally</td>
					<td>Build commands, code conventions, architectural rules</td>
			</tr>
			<tr>
					<td>On-demand workflows</td>
					<td>SKILL.md</td>
					<td>Task-description match</td>
					<td>Framework-specific guides, deployment runbooks</td>
			</tr>
			<tr>
					<td>Tool-specific rules</td>
					<td>.cursorrules / copilot-instructions</td>
					<td>Tool-dependent</td>
					<td>Tool-specific features and integrations</td>
			</tr>
			<tr>
					<td>User preferences</td>
					<td>Custom instructions</td>
					<td>Personal workflow</td>
					<td>Editor preferences, personal shortcuts</td>
			</tr>
			<tr>
					<td>Repository context</td>
					<td>AGENTS.md (root)</td>
					<td>Repository-wide</td>
					<td>Global conventions, cross-cutting rules</td>
			</tr>
	</tbody>
</table>
<p>The five configuration layers for AI agents in 2026, as catalogued by Agensi, are: Custom instructions (always-on context), SKILL.md skills (on-demand expertise), MCP servers (external tool access), Cursor rules (editor-specific), and AGENTS.md (repository context) [1]. Each layer addresses a different scope. Together they form a stack, but the interaction between layers is underspecified, and no tool currently validates that layer N doesn&rsquo;t contradict layer N-1.</p>
<h2 id="security-when-your-repos-instructions-become-an-attack-surface">Security: When Your Repo&rsquo;s Instructions Become an Attack Surface</h2>
<p>AGENTS.md is instructions, not documentation. Coding agents treat its contents as behavioral directives; they follow them. A one-line addition that says &lsquo;run tests with &ndash;coverage before committing&rsquo; changes every AI-assisted commit to your repository. If someone can modify your AGENTS.md, they can control every AI agent that touches your codebase.</p>
<p>The governance model needs to match the threat model. GitHub Well-Architected recommends repository rulesets to protect agentic primitive files: AGENTS.md, SKILL.md, MCP configurations, and .cursorrules [5]. The pattern is straightforward: require PR review from a designated owner for any change to files in the agentic configuration surface. Branch protection rules that enforce independent review add a second layer.</p>
<div class="alert alert-alert">
  <p class="alert-heading">ALERT</p>
  <p>Treat AGENTS.md as IAM-grade policy. If someone can modify it, they can control every AI agent that touches your repository. The file deserves CODEOWNERS protection and mandatory PR review, same as your CI pipeline configuration.</p>
</div><p>A reasonable precaution: scanning for suspicious patterns (curl pipes, eval calls, encoded payloads) in AGENTS.md diffs catches the obvious attacks. What it doesn&rsquo;t catch is subtler manipulation: instructions that bias the agent toward vulnerable code patterns, or directives that disable safety checks in specific edge cases. The most dangerous AGENTS.md compromise isn&rsquo;t a blatant attack; it&rsquo;s an instruction that looks reasonable at first glance but systematically weakens the codebase over time.</p>
<p>The practical implication: AGENTS.md is infrastructure, not documentation. It lives alongside your CI config, your deployment manifests, and your secrets management, and it deserves the same level of change control. If your team wouldn&rsquo;t accept an unreviewed change to .github/workflows/deploy.yml, they shouldn&rsquo;t accept one to AGENTS.md either.</p>
<h2 id="designing-an-agentsmd-that-agents-actually-follow">Designing an AGENTS.md That Agents Actually Follow</h2>
<p>Both the AGENTS.md specification and Harness recommend four required sections: Overview (what this project does, in two sentences); Build/Test (exact commands, not explanations); Workflow (how work moves from idea to merged PR); and Pitfalls (what will definitely break if you do it wrong) [2] [8].</p>
<p>Write imperatively, not narratively: &lsquo;Run pytest with -x &ndash;ff to stop on first failure and retry failures first&rsquo; beats &lsquo;Our testing strategy involves pytest, which we recommend running with flags that optimize for developer feedback loops.&rsquo; Agents don&rsquo;t need persuasion; they need commands. Save the narrative for the README. Humans read that; agents read this.</p>
<p>The OpenAI Agents Python SDK provides a concrete example of what works [1]. Their AGENTS.md includes mandatory $code-change-verification, a directive that forces the agent to verify every code change against project rules before completing the task. It scopes rules to specific directories using file path patterns; it&rsquo;s under 300 lines, keeping the file parseable rather than exhaustive.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-markdown" data-lang="markdown"><span style="display:flex;"><span># AGENTS.md minimal template
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## Overview
</span></span></span><span style="display:flex;"><span>This project is a payment processing service in Go.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## Build &amp; Test
</span></span></span><span style="display:flex;"><span>go build ./...
</span></span><span style="display:flex;"><span>go test -race -count=1 ./...
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## Workflow
</span></span></span><span style="display:flex;"><span><span style="color:#66d9ef">1.</span> Branch from main, prefix: feat/, fix/, chore/
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">2.</span> All PRs require CHANGELOG entry
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">## Pitfalls
</span></span></span><span style="display:flex;"><span><span style="color:#66d9ef">-</span> Never call ProcessRefund() without locking the transaction row first.
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">-</span> Docker Compose needs at least 4GB RAM allocated.
</span></span></code></pre></div><h2 id="practical-takeaways">Practical Takeaways</h2>
<ol>
<li>Add AGENTS.md to your repository root with at minimum build commands, test commands, and two project-specific pitfalls. Skip the prose; agents need directives.</li>
<li>Protect your AGENTS.md with CODEOWNERS and require PR review for changes to any agentic configuration file. It controls every AI agent that touches your codebase.</li>
<li>If your AGENTS.md exceeds 300 lines, decompose into hierarchical files following your directory structure rather than growing a single file.</li>
<li>Document the four required sections: Overview, Build/Test, Workflow, and Pitfalls. This structure gives agents a consistent pattern to parse.</li>
<li>For multi-tool teams: symlink CLAUDE.md → AGENTS.md for the simple case, but maintain both files if you need agent-specific instructions.</li>
</ol>
<h2 id="conclusion">Conclusion</h2>
<p>Most teams still scatter their build conventions across wikis, onboarding docs, and Slack threads no tool will ever parse. The shift worth watching is small but compounding: once a repository can state its own rules where machines read them, every future agent and every new hire starts from the same page instead of guessing. The teams writing that file today are quietly removing a class of errors the rest will keep debugging.</p>
<h2 id="frequently-asked-questions">Frequently Asked Questions</h2>
<h3 id="can-i-use-agentsmd-with-claude-code">Can I use AGENTS.md with Claude Code?</h3>
<p>Not directly. Claude Code reads CLAUDE.md as its native configuration file, not AGENTS.md [6]. You can symlink CLAUDE.md → AGENTS.md, and it works for simple cases. See the multi-tool comparison table above for the full breakdown of which tools read which files.</p>
<h3 id="should-i-use-one-agentsmd-or-multiple-nested-files">Should I use one AGENTS.md or multiple nested files?</h3>
<p>Start with one file at the repo root. When it exceeds 300 lines, decompose into nested files following your directory structure. The hierarchy is automatic: an agent working in src/payments/ picks up root → payments instructions in order, so modular instructions don&rsquo;t require the agent to know which files to load. Monorepos benefit most from hierarchical decomposition. OpenAI&rsquo;s repo uses 88 nested AGENTS.md files for exactly this reason [2].</p>
<h3 id="should-i-put-my-agentsmd-in-gitignore">Should I put my AGENTS.md in .gitignore?</h3>
<p>No. AGENTS.md is version-controlled infrastructure, same as your CI config. If it&rsquo;s not in the repo, it&rsquo;s not real.</p>
<h3 id="how-does-agentsmd-interact-with-my-existing-cursorrules-file">How does AGENTS.md interact with my existing .cursorrules file?</h3>
<p>Cursor natively supports AGENTS.md, so you can migrate your .cursorrules content into it and benefit from tool-agnostic formatting. However, .cursorrules supports Cursor-specific features that AGENTS.md doesn&rsquo;t: chat preferences, model selection hints, inline editing behavior. The cleanest approach: move everything tool-agnostic to AGENTS.md (build commands, testing conventions, architecture rules) and keep only Cursor-specific preferences in .cursorrules. The intersection shouldn&rsquo;t be large. If it is, your .cursorrules is doing double duty as project documentation — exactly what AGENTS.md replaces [1].</p>
<h3 id="does-agentsmd-work-with-github-copilot">Does AGENTS.md work with GitHub Copilot?</h3>
<p>Yes. GitHub Copilot reads AGENTS.md and has published its own guidance on writing effective files based on analysis of over 2,500 repositories. That guidance recommends covering six core areas: commands, testing, project structure, code style, git workflow, and boundaries [4]. Note that GitHub&rsquo;s guidance is specifically about Copilot&rsquo;s agents.md persona system (files stored in .github/agents/) which is distinct from the root-level AGENTS.md standard. The six areas are broadly applicable to any agent that reads AGENTS.md, but the deployment mechanism differs.</p>
<hr>
<h2 id="sources">Sources</h2>
<table>
	<thead>
			<tr>
					<th>#</th>
					<th>Publisher</th>
					<th>Title</th>
					<th>URL</th>
					<th>Date</th>
					<th>Type</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>1</td>
					<td>Agensi</td>
					<td>&ldquo;How to Configure AI Coding Agents: SKILL.md, AGENTS.md, CLAUDE.md &amp; .cursorrules&rdquo;</td>
					<td><a href="https://www.agensi.io/learn/ai-agent-configuration-guide-2026" target="_blank">https://www.agensi.io/learn/ai-agent-configuration-guide-2026</a>
</td>
					<td>2026-04</td>
					<td>Blog</td>
			</tr>
			<tr>
					<td>2</td>
					<td>Harness</td>
					<td>&ldquo;Why AGENTS.MD is the New Standard&rdquo;</td>
					<td><a href="https://www.harness.io/blog/the-agent-native-repo-why-agents-md-is-the-new-standard" target="_blank">https://www.harness.io/blog/the-agent-native-repo-why-agents-md-is-the-new-standard</a>
</td>
					<td>2026-01</td>
					<td>Blog</td>
			</tr>
			<tr>
					<td>3</td>
					<td>Vercel</td>
					<td>&ldquo;AGENTS.md outperforms skills in our agent evals&rdquo;</td>
					<td><a href="https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals" target="_blank">https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals</a>
</td>
					<td>2026-01</td>
					<td>Blog</td>
			</tr>
			<tr>
					<td>4</td>
					<td>GitHub</td>
					<td>&ldquo;How to write a great agents.md: Lessons from over 2,500 repositories&rdquo;</td>
					<td><a href="https://github.blog/ai-and-ml/github-copilot/how-to-write-a-great-agents-md-lessons-from-over-2500-repositories/" target="_blank">https://github.blog/ai-and-ml/github-copilot/how-to-write-a-great-agents-md-lessons-from-over-2500-repositories/</a>
</td>
					<td>2025-11</td>
					<td>Blog</td>
			</tr>
			<tr>
					<td>5</td>
					<td>GitHub Well-Architected</td>
					<td>&ldquo;Governing agents in GitHub Enterprise&rdquo;</td>
					<td><a href="https://wellarchitected.github.com/library/governance/recommendations/governing-agents/" target="_blank">https://wellarchitected.github.com/library/governance/recommendations/governing-agents/</a>
</td>
					<td>2026-04</td>
					<td>Documentation</td>
			</tr>
			<tr>
					<td>6</td>
					<td>Manifold Markets</td>
					<td>&ldquo;Claude Code Configuration: CLAUDE.md and AGENTS.md&rdquo;</td>
					<td><a href="https://manifold.markets/bessarabov/will-claude-code-support-agentsmd-i" target="_blank">https://manifold.markets/bessarabov/will-claude-code-support-agentsmd-i</a>
</td>
					<td>2026-05</td>
					<td>Blog</td>
			</tr>
			<tr>
					<td>7</td>
					<td>Termdock</td>
					<td>&ldquo;SKILL.md vs CLAUDE.md vs AGENTS.md: Complete Comparison&rdquo;</td>
					<td><a href="https://www.termdock.com/blog/skill-md-vs-claude-md-vs-agents-md" target="_blank">https://www.termdock.com/blog/skill-md-vs-claude-md-vs-agents-md</a>
</td>
					<td>2026-05</td>
					<td>Blog</td>
			</tr>
			<tr>
					<td>8</td>
					<td>AGENTS.md Official</td>
					<td>&ldquo;AGENTS.md Specification&rdquo;</td>
					<td><a href="https://agents.md" target="_blank">https://agents.md</a>
</td>
					<td>2026-05</td>
					<td>Documentation</td>
			</tr>
	</tbody>
</table>
<h2 id="image-credits">Image Credits</h2>
<ul>
<li><strong>Cover photo</strong>: Image generated with flux-pro-1.1 (Agents&rsquo; Codex AI illustration)</li>
</ul>
]]></content:encoded><media:content url="https://agentscodex.com/images/covers/2026-05-22-agents-md-self-describing-repositories/cover.jpg" medium="image"/><media:thumbnail url="https://agentscodex.com/images/covers/2026-05-22-agents-md-self-describing-repositories/cover.jpg"/></item></channel></rss>