AGENTS.md vs CLAUDE.md: one file for every agent?
Make AGENTS.md the one source: Codex reads it natively, and Claude Code reads it when the project has no CLAUDE.md, or through a CLAUDE.md that starts with @AGENTS.md. Gemini CLI reads GEMINI.md unless you point it at AGENTS.md.
Contents
We make Shuriken. We tried to be fair; corrections welcome at office@shuriken.sh.
Quick answer#
In the AGENTS.md vs CLAUDE.md choice, make AGENTS.md the one source. Codex reads it natively. Claude Code has read it since v2.1.277, but only when the project has no CLAUDE.md, so for Claude-only lines keep a CLAUDE.md that starts with @AGENTS.md. Gemini CLI reads GEMINI.md until you point it at AGENTS.md.
Both files are a README for agents. AGENTS.md is the name many tools agreed on, and CLAUDE.md is Claude Code's own, with imports, path rules and a private layer on top. Each tool's docs below were read on 22 October 2026.
At a glance#
| Claude Code | Codex | Gemini CLI | |
|---|---|---|---|
| Project file it reads | CLAUDE.md or .claude/CLAUDE.md |
AGENTS.md (AGENTS.override.md first) |
GEMINI.md |
| Reads AGENTS.md? | Yes, when no CLAUDE.md is present (v2.1.277+), or alongside it via a setting | Yes, natively | When listed in context.fileName |
| Your personal file | ~/.claude/CLAUDE.md; CLAUDE.local.md per project |
~/.codex/AGENTS.md (or AGENTS.override.md) |
~/.gemini/GEMINI.md |
| Folders it walks | Working folder and every parent at launch; subfolders when Claude touches them | Project root down to your working folder, at most one file per folder | A hierarchy, concatenated and sent with every prompt |
| Which wins | All are concatenated; the closest is read last | Closer files appear later and override earlier ones | All are concatenated |
| Imports | @path, up to four hops deep |
Not in its AGENTS.md docs | @file.md |
| Size | Aim for under 200 lines per file; files over 4 MiB are skipped | Stops adding files at 32 KiB combined (project_doc_max_bytes) |
No limit stated on the page |
| Other names | Rules in .claude/rules/, scoped by paths: |
Extra names via project_doc_fallback_filenames |
Any names via context.fileName |
What AGENTS.md does well#
The AGENTS.md site calls it "a simple, open format for guiding coding agents", "now stewarded by the Agentic AI Foundation under the Linux Foundation". Its list of tools that read the file has Codex, Cursor, GitHub Copilot's coding agent, Gemini CLI, Aider, goose, opencode, Zed, Warp, Junie and Amp on it, and more. A new agent you install has a good chance of finding it without any setup.
There is no syntax to learn. The site's own line is "Think of AGENTS.md as a README for agents."
In a monorepo, "the closest AGENTS.md to the edited file wins". Codex's docs give the order: from the project root down to your working folder, at most one file per folder, and "files closer to your current directory override earlier guidance because they appear later in the combined prompt."
What CLAUDE.md does well#
CLAUDE.md is Claude Code's file, and Claude Code's memory docs list what comes with it:
@docs/git-instructions.mdimports another file, up to four hops deep- files in
.claude/rules/with apaths:list load only when Claude touches a matching file CLAUDE.local.mdsits next to the team file for your own notes- auto memory, Claude's own notes, loads alongside your instructions
/memoryopens the files,/contextshows which ones loaded, andInstructionsLoadedhooks fire when they load
An AGENTS.md that Claude Code reads directly gets most of this. The docs list three differences: InstructionsLoaded hooks don't fire for it, an AGENTS.md in a folder added with --add-dir doesn't load, and an @path import outside your project loads only if you already approved external imports.
How to keep one source for every agent#
Each of these keeps a single AGENTS.md as the source.
AGENTS.md only#
Delete CLAUDE.md. Claude Code (v2.1.277+), Codex and the tools on the AGENTS.md list read the file as it is. Anthropic's docs flag one catch: a CLAUDE.local.md counts as a CLAUDE.md, so adding one for private notes stops Claude from reading AGENTS.md. Setting Project instructions to claude-md-and-agents-md in /config keeps both.
A CLAUDE.md that imports AGENTS.md#
This is the layout Anthropic shows, and the one that bends furthest:
@AGENTS.md
## Claude Code
Use plan mode for changes under `src/billing/`.
Claude reads AGENTS.md first, then the Claude-only lines under it. It also works in sessions that can't read AGENTS.md directly, such as older versions.
A symlink#
ln -s AGENTS.md CLAUDE.md is fine while the two files never differ. The docs give two caveats. Claude's Edit tool won't write through a symlink (it edits the target instead), and on Windows Git checks a committed symlink out as a one-line text file unless core.symlinks is on. If anyone clones on Windows, use the import.
Our own repository does it the other way round: AGENTS.md is a link to CLAUDE.md, at the root and in packages/server. We develop on Macs and Linux machines, so it works for us, and the Windows caveat would apply to us too.
Gemini CLI#
Gemini CLI takes its file names from context.fileName in settings.json, so list both:
{
"context": {
"fileName": ["AGENTS.md", "GEMINI.md"]
}
}
A GEMINI.md whose only line is @AGENTS.md does the same job. Gemini CLI's docs now carry a notice for unpaid-tier and Google One users: "Gemini CLI was replaced by Antigravity CLI on June 18th, 2026." On those tiers, look up which file Antigravity CLI reads before you rely on GEMINI.md or AGENTS.md.
Where Shuriken is different#
Shuriken runs Claude Code, Codex, Gemini CLI and 64 more agents in the same project, so we met the "which file?" question early. After you add a project, Shuriken opens a sheet that makes AGENTS.md the single instruction file, with "Set up later" and "Don't ask again" if you'd rather not. What the sheet offers depends on the files it finds:
| Found in the project | Sheet title | What happens |
|---|---|---|
| No instructions | Set up AGENTS.md | Creates AGENTS.md |
| One agent's file, say CLAUDE.md | Move CLAUDE.md to AGENTS.md | Its content moves into AGENTS.md |
| Several files that disagree | Merge instructions into AGENTS.md | One call on a helper model, on one of your own sources, merges them |
For a merge, the sheet shows the model and the rough cost first, and you review the result before anything is written. Then Shuriken points every other agent at AGENTS.md: a CLAUDE.md, GEMINI.md or QWEN.md that imports it with @AGENTS.md, a one-line reference in Copilot's instructions file, and read: AGENTS.md in Aider's config. Agents that read AGENTS.md natively get nothing extra. Scoped rule folders such as .cursor/rules stay where they are, and the originals are copied to a backup folder first. In the project's Knowledge section, the Instructions card then lists AGENTS.md as the file every agent reads, and each pointer as Linked, or as "Has its own content" once someone has typed into it.
Personal files work across accounts too. Every Claude account you add gets its own CLAUDE_CONFIG_DIR, and every Codex account its own CODEX_HOME. Shuriken links your ~/.claude/CLAUDE.md and ~/.codex/AGENTS.md into each of those folders, so a switch to another account keeps the same instructions. Running both agents on one repo is covered in Claude Code and Codex in one project.
Cost#
Both are plain text files, and Shuriken's setup for them is on every plan. The optional merge is the one exception: that helper-model call is billed to your own source, and the sheet shows the model and its rough cost before you run it, or says the cost is unknown.
The file's real price is context. Every agent that reads it loads all of it at the start of every session. Anthropic aims for under 200 lines per file, and Codex stops adding files at 32 KiB. How to keep it short is in what Claude Code remembers between sessions; what goes in it, under either name, is in CLAUDE.md best practices.
Using them together#
Both names can live in one repository with one text behind them. Keep AGENTS.md as the shared source, with the common rules in it. CLAUDE.md, when Claude Code needs lines of its own, starts with @AGENTS.md, and GEMINI.md can do the same. Choosing between the agents themselves rather than their files is Claude Code vs Codex.
Sources
- How Claude remembers your project: AGENTS.md (Claude Code docs) (accessed 22 October 2026)
- Custom instructions with AGENTS.md (OpenAI Codex docs) (accessed 22 October 2026)
- AGENTS.md (agents.md) (accessed 22 October 2026)
- Provide context with GEMINI.md files (Gemini CLI docs) (accessed 22 October 2026)
Frequently asked questions
Does Claude Code read AGENTS.md?
Yes, from v2.1.277. By default it reads AGENTS.md when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your working folder or above it. With both, it reads only CLAUDE.md unless you set Project instructions to claude-md-and-agents-md in /config.
Should I symlink CLAUDE.md to AGENTS.md or import it?
Import it when you need Claude-only lines or anyone works on Windows: a CLAUDE.md that starts with @AGENTS.md. A symlink is fine when the files are identical and everyone is on macOS or Linux, because Git on Windows can check a symlink out as a plain text file.
Does Codex read CLAUDE.md?
Not by default. Codex reads AGENTS.override.md, then AGENTS.md, in each folder from the project root down. You can add other names with project_doc_fallback_filenames in its config.
What about GEMINI.md?
Gemini CLI reads GEMINI.md by default. Its docs show how to list AGENTS.md in the context.fileName setting, or a GEMINI.md can import AGENTS.md with @AGENTS.md.
Can AGENTS.md and CLAUDE.md say different things?
They can. Anthropic's memory docs warn that if two instructions contradict each other, Claude may pick one arbitrarily, so keep the shared rules in AGENTS.md and put Claude-only lines under the @AGENTS.md line of CLAUDE.md, not in a second copy.