Does Claude Code read AGENTS.md? Files each AI agent reads
Most agents read AGENTS.md: Cursor, Devin, Codex, Kimi Code CLI, OpenHands, and Pi. Claude Code reads CLAUDE.md and falls back to AGENTS.md. Gemini CLI and Aider read their own files, and AGENTS.md only when configured to. Checked against each agent's docs on 27 Nov 2026. How repos are set up for each, side by side: compare agents.
By Himanshu Singh · Updated · How we score →
Which agents read which file
Each cell links the agent's docs. Fallback: read only when CLAUDE.md is missing. Setting: read once configured. —: the docs don't say. The last row is the share of 388 popular GitHub repos with the file, at any depth, on 16 Nov 2026.
Files each agent reads
| Agent | Reads from the repo | Notes |
|---|---|---|
| Claude Code |
| Reads AGENTS.md only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md is found (v2.1.277 and later). A CLAUDE.md that imports @AGENTS.md loads both, as does a setting. code.claude.com/memory (new tab)code.claude.com/skills (new tab) |
| Cursor |
| Project rules are .mdc files in .cursor/rules/, subfolders included; a plain .md there is ignored. AGENTS.md is read at the root and in subdirectories, combined, the more specific winning. CLAUDE.md is read the same way; the docs describe one at the root. A root .cursorrules is legacy and will be deprecated. cursor.com/rules (new tab)cursor.com/skills (new tab)cursor.com/rules (new tab)cursor.com/using (new tab) |
| Devin |
| Looks for AGENTS.md before it starts coding and includes its first 16 KiB. Pulls CLAUDE.md and Cursor rule files into its Knowledge, which its docs mark deprecated in favour of Skills. Setup comes from its environment snapshot, which .devin/blueprint.yaml can define. docs.devin.ai/environment (new tab)docs.devin.ai/agents-md (new tab)docs.devin.ai/knowledge-onboarding (new tab)docs.devin.ai/skills (new tab)docs.devin.ai/git-backed-blueprints (new tab) |
| Codex |
| Reads AGENTS.md before any work, one per directory from the repo root down to the working directory, up to 32 KiB combined; AGENTS.override.md replaces the AGENTS.md beside it. learn.chatgpt.com/agents-md (new tab)learn.chatgpt.com/build-skills (new tab) |
| Kimi Code CLI |
| /init writes an AGENTS.md. Its docs name no CLAUDE.md fallback. github.com/agents.md (new tab)github.com/slash-commands.md (new tab)github.com/skills.md (new tab) |
| Gemini CLI |
| Reads GEMINI.md from the global file, the workspace and its parent directories, and one per subdirectory once a tool reaches it. AGENTS.md loads once listed in the context.fileName setting. geminicli.com/gemini-md (new tab)geminicli.com/skills (new tab) |
| Aider |
| Reads AGENTS.md or CONVENTIONS.md only when .aider.conf.yml lists it under read:. Its docs name only .aider.conf.yml, never .aider.conf.yaml. aider.chat/lint-test.html (new tab)aider.chat/aider_conf.html (new tab) |
| OpenHands |
| Runs .openhands/setup.sh when it starts work on a repo. Treats CLAUDE.md and GEMINI.md as context for Claude and Gemini models. docs.openhands.dev/repository (new tab)docs.openhands.dev/skills (new tab)docs.openhands.dev/overview (new tab) |
| Pi |
| Loads the first of AGENTS.override.md, AGENTS.md and CLAUDE.md from the working directory and every directory above it, so an empty AGENTS.md hides a CLAUDE.md beside it. github.com/configuration.md (new tab)github.com/skills.md (new tab)github.com/security.md (new tab)github.com/resource-loader.ts (new tab) |
How do repos score for each pair of agents?
| Comparison | Averages | Higher for each |
|---|---|---|
| Claude Code vs Cursor | 81.0 vs 71.3 | 419 vs 15 |
| Claude Code vs Codex | 81.0 vs 78.7 | 346 vs 86 |
| Gemini CLI vs Claude Code | 71.4 vs 81.0 | 4 vs 430 |
| Cursor vs Codex | 71.3 vs 78.7 | 19 vs 415 |
| Aider vs Claude Code | 72.6 vs 81.0 | 19 vs 415 |
| OpenHands vs Claude Code | 71.3 vs 81.0 | 3 vs 430 |
| Pi vs Claude Code | 77.5 vs 81.0 | 42 vs 376 |
| Kimi Code CLI vs Claude Code | 77.6 vs 81.0 | 44 vs 352 |
| Devin vs Claude Code | 75.3 vs 81.0 | 3 vs 430 |
| Codex vs Gemini CLI | 78.7 vs 71.4 | 428 vs 6 |
Averages over the board's repos scored for both agents. “Higher for each” counts the repos that score higher for the first agent, then the second; the rest tie. Scores measure how well a repo is set up for an agent, not which agent writes better code.
Other tools, not on our board
| Tool | Reads from the repo | AGENTS.md? | Docs |
|---|---|---|---|
| GitHub Copilot |
| Cloud agent, code review, CLI and VS Code | |
| Google Antigravity |
| Yes, with GEMINI.md | |
| OpenCode |
| Yes, CLAUDE.md as fallback | |
| Devin Desktop (formerly Windsurf) |
| Yes, always on | |
| Kiro |
| Yes, always included |
Does my agent read AGENTS.md?
- Does Claude Code read AGENTS.md?
- Yes, when there is no CLAUDE.md. Claude Code v2.1.277 and later reads AGENTS.md and
.claude/AGENTS.mdby default, but only when no CLAUDE.md,.claude/CLAUDE.mdor CLAUDE.local.md is in the working directory or above it. With both files, import@AGENTS.mdin CLAUDE.md, or set Project instructions in/configtoclaude-md-and-agents-md. Run/memoryto see what loaded. - Does Cursor read AGENTS.md?
- Yes. Cursor reads AGENTS.md at the project root and in subdirectories, the more specific winning, and reads CLAUDE.md the same way (its docs describe one at the root). Its own project rules are
.mdcfiles in.cursor/rules/. - Does Devin read AGENTS.md?
- Yes. Devin looks for AGENTS.md anywhere in the repo before it starts coding, and includes the first 16 KiB of each. It also pulls CLAUDE.md and Cursor rule files into its Knowledge, which its docs mark deprecated in favour of Skills.
- Does Codex read AGENTS.md?
- Yes. Codex reads AGENTS.md before any work, one per directory from the repo root down to the working directory, an AGENTS.override.md taking its place, up to 32 KiB combined. It reads CLAUDE.md only if
project_doc_fallback_filenameslists it. - Does Kimi Code CLI read AGENTS.md?
- Yes. Kimi Code CLI reads AGENTS.md or
.kimi-code/AGENTS.mdfrom the project, and/initwrites one. Its docs name no CLAUDE.md fallback. - Does Gemini CLI read AGENTS.md?
- Only when configured to. Gemini CLI reads GEMINI.md by default. List AGENTS.md in
context.fileNamein.gemini/settings.json, or make GEMINI.md the line@AGENTS.md. Run/memory showto see what loaded. - Does Aider read AGENTS.md?
- Only when configured to. Aider reads only the files you hand it: list AGENTS.md under
read:in.aider.conf.yml, or pass--read AGENTS.md. - Does OpenHands read AGENTS.md?
- Yes. OpenHands reads AGENTS.md as repository context, and treats CLAUDE.md and GEMINI.md as context for Claude and Gemini models.
- Does Pi read AGENTS.md?
- Yes. Pi loads AGENTS.md from the working directory and every directory above it. An AGENTS.override.md replaces it, and a CLAUDE.md is read where there is no AGENTS.md.
- Does GitHub Copilot read AGENTS.md?
- On some surfaces. Copilot cloud agent and code review read AGENTS.md files anywhere in the repo, the nearest one taking precedence, or a single root CLAUDE.md or GEMINI.md instead. Copilot CLI combines every AGENTS.md, CLAUDE.md and GEMINI.md from the repo root to the working directory and on the path to each file it works on. In VS Code, the Copilot harness combines every AGENTS.md on its path; the Local harness reads a root one only with
chat.useAgentsMdFileon, and nested ones only with the experimentalchat.useNestedAgentsMdFileson as well. Copilot's own file, its CLAUDE.md equivalent, is.github/copilot-instructions.md, which every surface but Eclipse code review reads; the support matrix lists no AGENTS.md for chat on github.com or in Visual Studio, JetBrains, Eclipse or Xcode. - Does Google Antigravity read AGENTS.md?
- Yes. Antigravity reads AGENTS.md or GEMINI.md, at the top of a folder or in its
.agents/, plus.agents/rules/*.md, in the workspace folder and its parents up to the repo root, and combines every rule it finds. Subfolders below the workspace are not loaded, and each rule file is capped at 24,000 bytes. - Does OpenCode read AGENTS.md?
- Yes. OpenCode loads every AGENTS.md from the current directory up to the home directory (the project root, for a project outside it), after the global
~/.config/opencode/AGENTS.md, and reads CLAUDE.md in any directory without one. Reading a file below it, such as one in a monorepo package, also loads the AGENTS.md files on the way. Other instruction files go in theinstructionslist inopencode.json. - Does Devin Desktop (formerly Windsurf) read AGENTS.md?
- Yes. Windsurf became Devin Desktop on June 2, 2026, and treats AGENTS.md as an always-on rule, read in each directory from the workspace root down to the working directory. Its own rules go in
.devin/rules/*.md; the legacy.windsurf/rules/and.windsurfrulesare still read. - Does Kiro read AGENTS.md?
- Yes. Kiro reads AGENTS.md in the workspace root and subdirectories and always includes it. Its own steering files go in
.kiro/steering/, with an inclusion mode in their frontmatter:always,fileMatch,manualorauto.
Checked against each tool's docs on .
How do I write one file every agent reads?
- Write it in
AGENTS.mdat the repo root. What to put in it. - If you keep a CLAUDE.md, import
@AGENTS.mdin it, or Claude Code skips AGENTS.md. AGENTS.md vs CLAUDE.md. - Aider: list AGENTS.md under
read:in.aider.conf.yml. Gemini CLI: add it tocontext.fileName, or keep a GEMINI.md. - Cursor rules go in
.cursor/rules/, OpenHands setup in.openhands/setup.sh. - Longer task steps go in
.agents/skills/, which every agent here but Claude Code and Aider loads when a task matches. Agent skills.
How many repos have each file?
AGENTS.md243 of 434 (56%).agents/skills80 of 434 (18%).cursor/rules or .cursorrules23 of 434 (5%)CLAUDE.mdonly17 of 434 (4%)GEMINI.md7 of 434 (2%).openhands/setup.sh2 of 434 (0.5%).aider.conf.yml1 of 434 (0.2%)
A repo with both files counts under AGENTS.md unless it is empty; empty files don't count. Read the files.
Agent names link to their boards. The methodology has every weight; the guide covers the rest of an agent-ready repo.