AGENTS.md explained: how 7 AI coding tools read it in 2026

4 min readpresets.devUpdated
  • agents-md
  • claude-code
  • codex
  • copilot
  • cursor
On this page

AGENTS.md started as a simple idea: one Markdown file, at the root of a repo, that tells any coding agent how to work there. The agents.md site now says it's used by over 60,000 open-source projects, and the format is stewarded by the Agentic AI Foundation under the Linux Foundation.

"Supported by every tool" hides a lot of detail, though. Each tool discovers the file differently, handles nesting differently, and has its own way of combining it with tool-specific files. Here's the state of things in November 2026, checked against each tool's docs.

The short answer

ToolReads AGENTS.mdCombined with
OpenAI CodexYes, it's the native formatAGENTS.override.md, fallback names you configure
CursorYes, root and nested.cursor/rules/*.mdc
GitHub CopilotYes, anywhere; nearest wins.github/copilot-instructions.md, .github/instructions/
Claude CodeYes (v2.1.277+), when there's no CLAUDE.mdCLAUDE.md, .claude/rules/
Devin Desktop (ex-Windsurf)Yes, always on.devin/rules/, legacy .windsurf/rules/
ClineYes, project root.clinerules/, .cline/rules/
Antigravity CLIYes, always onGEMINI.md, .agents/rules/

Claude Code: the one with a condition

This is the most searched question, so it goes first. Claude Code reads AGENTS.md directly since v2.1.277, but by default only if there's no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your working directory or above it (Claude Code docs).

If you have both, Claude reads only CLAUDE.md. Two fixes:

CLAUDE.md
@AGENTS.md

## Claude Code only
- Prefer plan mode for multi-file refactors.

Or set Project instructions to claude-md-and-agents-md in /config. Watch out for CLAUDE.local.md: it counts as a CLAUDE.md, so adding a personal one quietly switches off AGENTS.md for you.

Claude Code never reads AGENTS.local.md, AGENTS.override.md or anything under .agents/, which matters for skills (more below).

Codex: the reference implementation

Codex builds a chain at startup (Codex docs):

  1. Your global ~/.codex/AGENTS.override.md or AGENTS.md.
  2. From the repo root down to your current folder, one file per folder: AGENTS.override.md if present, otherwise AGENTS.md.
  3. Concatenated root first, so deeper files win.

Two limits: it stops at your current folder (siblings aren't read), and it stops adding text at 32 KiB combined unless you raise project_doc_max_bytes.

Copilot: nearest file wins

Copilot accepts AGENTS.md files anywhere in the repo, and the nearest one in the directory tree takes precedence (GitHub docs). It also has its own .github/copilot-instructions.md, and accepts a single root CLAUDE.md or GEMINI.md instead of AGENTS.md.

So AGENTS.md vs. copilot-instructions.md? If you use more than one tool, put shared facts in AGENTS.md. Keep copilot-instructions.md for Copilot-only notes, or skip it.

Cursor: nested files follow your edits

Cursor reads AGENTS.md at the root and in subfolders. Nested files apply when the agent works on files in that folder, combined with parent files, with the more specific file taking precedence (Cursor docs). It's the "no frontmatter" alternative to .cursor/rules/.

Devin Desktop (formerly Windsurf)

Windsurf became Devin Desktop on June 2, 2026. Devin reads AGENTS.md, AGENT.md and AGENTS.local.md as always-on rules, from the workspace root down to the folder it's working in (Devin docs).

Cline

Cline detects AGENTS.md at the project root, plus ~/.agents/AGENTS.md globally, and lists it in the Rules panel next to .clinerules/, .cursorrules and .windsurfrules (Cline docs). Each can be toggled.

Antigravity CLI: up, never down

Antigravity CLI, which replaced Gemini CLI for personal accounts in June 2026, reads both AGENTS.md and GEMINI.md, always on, from your start folder up to the repo root (Antigravity docs). It doesn't load files in subfolders below the start folder, even when the agent edits there.

Rules are cumulative, so the same section in AGENTS.md and GEMINI.md loads twice. Pick one.

Nesting, compared

The same monorepo behaves differently depending on the tool:

repo/
├── AGENTS.md
└── packages/api/
    └── AGENTS.md

Start the agent at repo/ and edit packages/api/server.ts:

ToolLoads packages/api/AGENTS.md?
CursorYes, while working on files there
CopilotYes, it's the nearest file
Claude CodeYes, when it reads a file there (if it's reading AGENTS.md at all)
DevinYes
CodexNo: start Codex in packages/api/
Antigravity CLINo: start agy in packages/api/

A setup that works everywhere

AGENTS.md          # shared facts: commands, layout, boundaries, skill pointers
CLAUDE.md          # @AGENTS.md, plus Claude-only notes
.agents/skills/    # shared skills (Codex, Antigravity, Cursor, Copilot, Devin, Cline)
.claude/skills -> ../.agents/skills   # so Claude Code sees them too

Keep the root AGENTS.md small, push package details into nested files, and remind Codex and Antigravity users to start in the package they're working on.

Adding presets without clobbering your file

The presets CLI appends, never replaces:

npx presets-dev add nextjs --tool codex

Each stack lands between presets.dev:nextjs:start and presets.dev:nextjs:end HTML comment markers, so re-running is safe and removal is clean. For Antigravity, add --agents-md to use AGENTS.md instead of GEMINI.md.

Want the full walkthrough? Read AGENTS.md best practices and One repo, many AI tools.