One AGENTS.md for every tool: the late-2026 compatibility matrix

Six tools read the root file. Nested files, size caps and the .local and .override variants are where they split.

November 30, 2026 9 min read

One AGENTS.md at the root of your repo is read by Claude Code, Codex, Cursor, GitHub Copilot, Antigravity and Devin Desktop. As of December 2026 that part is settled. What isn't settled is everything after the root file: nested files, size caps, and the .local and .override variants each behave differently per tool, and two of the six truncate or demote your rules once you pass a size limit.

This is the matrix, built from each vendor's own docs as they read in late November 2026. We read the docs. We did not test every tool. Where a doc says nothing, we say so instead of guessing.

AGENTS.md supported tools: the short version

The format itself is plain Markdown with no required fields. The agents.md site says it's used by over 60k open-source projects and is now stewarded by the Agentic AI Foundation under the Linux Foundation.

AGENTS.md in Cursor, Claude Code, Codex and Copilot: tool by tool

Claude Code

Source: Claude Code memory docs.

The fallback rule trips up most people. We covered it in why your AGENTS.md isn't loading in Claude Code.

Codex

Source: Custom instructions with AGENTS.md.

Cursor

Source: Cursor rules docs.

GitHub Copilot

Sources: repository instructions and the support reference.

Antigravity

Source: Antigravity rules docs.

Devin Desktop, formerly Windsurf

Sources: Devin Desktop FAQ and Devin CLI rules docs.

Nested AGENTS.md precedence: three models, not one

The agents.md site gives a simple rule: the closest AGENTS.md to the edited file wins. Only some tools work that way.

Nearest file wins. That's Copilot's wording, and it matches the spec.

Everything loads, later wins. Codex concatenates from the root down to the directory you started in. Claude Code loads every AGENTS.md from the working directory upward. Cursor combines nested files with their parents. Nothing is replaced. The deeper file just comes last.

Parents only. Antigravity walks up from the workspace folder to the repo root and never down. A packages/api/AGENTS.md does nothing if you opened the repo root as your workspace. Codex has a similar edge: it stops at your current directory, so a nested file loads only if you start Codex at or below that folder.

Put the three side by side and the same monorepo behaves three ways. Open the root in Cursor and edit a file under packages/api/: the nested file applies. Do the same in Antigravity: it doesn't. Start Codex at the root: it doesn't. Start Codex inside packages/api/: it does.

So write the root file so it stands alone. Treat nested files as extra detail for the tools that pick them up, never as the only place a rule lives.

AGENTS.md size limit: the numbers that exist

Only three of the six tools publish a number.

Two things here are easy to miss.

The Codex cap is described two ways by OpenAI. The AGENTS.md guide says Codex stops adding files once the combined size reaches the limit. The advanced config page describes the same setting as how much to read from each AGENTS.md file. Combined and per-file aren't the same thing. Codex is open source, and its loader settles it: one shared budget across the project files, read from the root down, with the file that crosses the line cut at a byte offset. So a root file plus a nested file can cross 32 KiB together while each one looks small. Check the total.

Antigravity's token budget doesn't fail loudly. When always-on rules pass 20,000 tokens, it demotes the largest rule files from inline text to a one-line pointer that the agent can choose to read. Your biggest rule file is the first to become optional reading.

You can raise the Codex limit in ~/.codex/config.toml:

project_doc_max_bytes = 65536

The better fix is a smaller file. If one AGENTS.md has to work in every tool, the smallest published cap is your real limit: stay under 24,000 bytes. Check with wc -c AGENTS.md.

The variants only some tools read

Every tool reads AGENTS.md. The variants are where a file can sit in your repo for months and never be read by the tool you're using.

That last one cuts both ways. Your personal Claude Code preferences are quietly steering Devin as well.

Two more silent failures from the same docs, for anyone moving past a single file. In Cursor, a plain .md file inside .cursor/rules is ignored, because project rules must be .mdc. In Antigravity, a file in .agents/rules/ with missing frontmatter or an unrecognized trigger value is silently discarded. In both cases the vendor's advice is the same: if you want plain Markdown, put it in AGENTS.md.

One AGENTS.md for Cursor, Claude Code, Codex and Copilot: a layout that holds

As of December 2026, this is the layout we'd use for a repo that several tools touch:

repo/
  AGENTS.md            # the shared file, under 24,000 bytes, stands alone
  CLAUDE.md            # optional: "@AGENTS.md" plus Claude-only lines
  packages/
    api/
      AGENTS.md        # extra detail, never the only copy of a rule

Skip CLAUDE.md unless you need Claude-specific lines. If you add one, it must import AGENTS.md, or Claude Code stops reading the shared file.

Keep personal preferences out of the repo. The .local variants aren't portable, so use each tool's global file instead.

Don't rely on AGENTS.override.md unless your whole team is on Codex.

If you'd like a starting point, you can generate an AGENTS.md for your stack, then cut it down to what the agent can't work out from the code. Our older comparison of Cursor and Copilot context handling and the Windsurf rules setup guide predate most of the above, so trust this matrix where they disagree.

The compatibility question in late 2026 isn't "which tools support AGENTS.md". They all do. It's which nested files load, which variants are ignored, and where the size limit sits. Check those three for your own stack, build one file, and keep it small.

Doing this across a whole company? contextarch for teams shows which AI tool loads which instructions in every repo you have, and stops a pull request from breaking them.
contextarch.ai·Context Doctor·Setup check·Generator·Templates·Blog·Newsletter