Versus · AI tools
CLAUDE.md vs AGENTS.md
- Last checked
- 4 sources, linked below
- By the vectaai team
We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.
Verdict Our pick
The bar guide has a call.

- AGENTS.md as the one shared instructions file if more than one coding agent touches your repo (Codex, Cursor, Copilot, Gemini CLI, Jules and many more read it).
- CLAUDE.md when you only use Claude Code, or for Claude only extras.
Compared here
- 01AGENTS.md
- 02CLAUDE.md
Short answer
Use AGENTS.md as the one shared instructions file if more than one coding agent touches your repo (Codex, Cursor, Copilot, Gemini CLI, Jules and many more read it). Use CLAUDE.md when you only use Claude Code, or for Claude only extras. Best of both: keep your rules in AGENTS.md and add a tiny CLAUDE.md whose first line is @AGENTS.md, with any Claude specific lines below it.
Since Claude Code v2.1.277, Claude can read AGENTS.md directly, but by default only when there is no CLAUDE.md or CLAUDE.local.md in your working directory or above it. If both exist, Claude reads CLAUDE.md only, unless you change the Project instructions setting in /config. Below: the table, how each file loads, the CLAUDE.local.md trap, a ready to copy setup, and what to put in the file.
At a glance
| AGENTS.md | CLAUDE.md | |
|---|---|---|
| What it is | Open, plain Markdown "README for agents" | Claude Code's own instructions file |
| Who runs it | Stewarded by the Agentic AI Foundation under the Linux Foundation | Anthropic |
| Read by | Codex, Jules, Gemini CLI, Cursor, VS Code, Copilot coding agent, Devin, Windsurf, Aider, Zed, Warp and more (per agents.md); Claude Code since v2.1.277 | Claude Code (terminal, IDE, desktop, web) |
| Required format | None, standard Markdown | None, Markdown; supports @path imports |
| Scopes | Repo root plus nested files per folder | Managed (org), user (~/.claude), project, local, subfolders |
| When both nest | Closest file to the edited file wins | All found files are concatenated, root first |
| Personal, uncommitted file | Not defined by the format (AGENTS.local.md is not read by Claude Code) | CLAUDE.local.md, add to .gitignore |
| Claude Code default if both exist | Ignored | Read |
| Generate a starter | Write by hand or ask your agent | /init in Claude Code |
No money on this page. Nobody sells AGENTS.md or CLAUDE.md, there are no affiliate links here, and display ads may show around the text. Everything below comes from two official places, read on 3 December 2026: the agents.md site and Anthropic's Claude Code memory docs. Where a third party blog says something the docs do not, we leave it out.
The short version
Both files do the same job: they tell an AI coding agent how your project works. How to build it, how to run tests, what style to use, what never to touch. Think of it as the note you leave for a new teammate, except the teammate reads it every single time it starts work.
The difference is who reads them.
- AGENTS.md is an open format. The agents.md site calls it a "README for agents" and lists a long row of tools that read it: OpenAI's Codex, Google's Jules and Gemini CLI, Cursor, VS Code, GitHub Copilot's coding agent, Devin and Windsurf, JetBrains' Junie, Aider, Zed, Warp, Amp, goose, opencode and more. Kiro lists it among its supported standards too. It is now stewarded by the Agentic AI Foundation under the Linux Foundation.
- CLAUDE.md is Claude Code's own file. It does more for Claude specifically (imports, user level and organisation level files, a personal local file), and Claude Code reads it on every surface: terminal, IDE, desktop and web.
So the honest answer to "which one?" is usually both, but write your rules once. More on that setup below.
When Claude Code reads which file
This is the part most blog posts get wrong, because it changed. Older posts say Claude Code ignores AGENTS.md. That stopped being true. Per Anthropic's docs, reading AGENTS.md directly needs Claude Code v2.1.277 or later.
By default, here is what Claude reads:
- Only AGENTS.md in the repo, no CLAUDE.md or CLAUDE.local.md in your working directory or above: Claude reads your AGENTS.md. In an interactive session you see a line like
no CLAUDE.md found; AGENTS.md loaded. - AGENTS.md and a CLAUDE.md (or CLAUDE.local.md) in your working directory or above: Claude reads the CLAUDE.md files only.
- A CLAUDE.md that imports AGENTS.md: Claude reads the CLAUDE.md, with AGENTS.md pulled in through the import.
Some files do not count in that check and keep loading next to AGENTS.md: your personal ~/.claude/CLAUDE.md, your organisation's managed CLAUDE.md, and files under .claude/rules/.
Claude Code does not read AGENTS.local.md, AGENTS.override.md or anything under an .agents/ folder, per the same docs.
The CLAUDE.local.md trap
Here is the gotcha that bites teams. CLAUDE.local.md is meant for your personal, uncommitted notes for one project (your sandbox URL, your favourite test data). You add it to .gitignore and forget about it.
But because a CLAUDE.local.md counts in the check above, adding one to a repo that relies on AGENTS.md makes Claude stop reading the team's AGENTS.md, for you only. Your teammates get the rules; you silently do not. Anthropic's docs flag this directly.
The fix is one setting: type /config in Claude Code and set Project instructions to claude-md-and-agents-md. Or add @AGENTS.md to a CLAUDE.md.
The four Project instructions settings
Claude Code lets you choose the behaviour in /config under Project instructions:
claude-md-or-agents-md(the default): CLAUDE.md files, or AGENTS.md when there is no CLAUDE.md or CLAUDE.local.md.claude-md-and-agents-md: both, each folder's CLAUDE.md first, then its AGENTS.md. Claude skips an AGENTS.md it already loaded through an import or symlink, so nothing is read twice.claude-md: CLAUDE.md only.managed-only: only your organisation's managed CLAUDE.md and auto memory at launch.
The docs note that in a few cases (you disabled the built in plugin that reads AGENTS.md, or sometimes the first session after upgrading from an old version) Claude reads CLAUDE.md only and the setting does not appear. The universal fallback is the import.
The one file setup we recommend
If your team uses more than one coding tool, or might one day, do this:
- Put every shared rule in
AGENTS.mdat the repo root. - Create a
CLAUDE.mdnext to it with this content:
@AGENTS.md
## Claude Code
Use plan mode for changes under src/billing/.
That is the exact pattern Anthropic's docs show. The @AGENTS.md line pulls the shared file in. Anything below it is for Claude only. Every other agent reads AGENTS.md as normal. You maintain one file.
What about a symlink? The docs also show ln -s AGENTS.md CLAUDE.md for when you need no Claude only content. Two catches from the docs: Claude Code's edit tools refuse to write through a symlink and tell Claude to edit AGENTS.md instead, and a symlink that points outside your project is treated like an external import that needs approval. Symlinks can also be awkward on some Windows setups. The import line is the safer default.
What CLAUDE.md can do that AGENTS.md cannot
AGENTS.md is deliberately simple: one Markdown file, no required fields, nested copies per folder. CLAUDE.md has more layers, per Anthropic's docs:
- Managed (organisation) level: a CLAUDE.md that IT deploys to every developer machine, for company rules.
- User level:
~/.claude/CLAUDE.mdfor your personal preferences across all projects. - Project level:
./CLAUDE.mdor./.claude/CLAUDE.md, committed for the team. - Local level:
./CLAUDE.local.mdfor your private notes on one project. - Imports:
@path/to/filepulls in other files, up to four hops deep. - Path scoped rules: files in
.claude/rules/that load only when Claude touches matching files, which keeps context small. - Auto memory: notes Claude writes itself from your corrections, loaded up to the first 200 lines or 25 KB.
/init: generates a starter CLAUDE.md by reading your codebase.
None of that breaks AGENTS.md. It just means Claude Code users get extra knobs. The import setup above gives you both.
How nesting works in each
In a monorepo you often want different rules per package.
- AGENTS.md: per the agents.md site, put an AGENTS.md in each subproject. Agents read the nearest file in the folder tree, and the closest one takes precedence. The site notes OpenAI's main repo has 88 of them. If a user's chat prompt says something different, the prompt wins.
- CLAUDE.md: Claude Code loads every CLAUDE.md and CLAUDE.local.md from your working directory up to the root and joins them, root first, so the file closest to where you launched is read last. Files in subfolders load when Claude reads or edits something in that folder.
Practical effect: with AGENTS.md, a package file replaces the root rules for that package. With CLAUDE.md, a package file adds to the root rules. Write accordingly.
What to put in the file
The agents.md site suggests these sections: project overview, build and test commands, code style guidelines, testing instructions and security considerations, plus commit or pull request rules and deployment steps if they matter.
Anthropic adds a size rule we like: target under 200 lines per CLAUDE.md, because longer files use more context and get followed less well. Imports organise a long file but do not make it cheaper, because imported files load too.
Our rule of thumb for both files:
- Write what the agent cannot guess. It can read your code. It cannot guess that tests need a running database, or that
legacy/must never be touched. - Commands beat prose.
npm test -- --watch=falseis better than "run the tests". - Say no clearly. "Never commit
.envfiles" works better than "be careful with secrets". - Prune monthly. Stale rules are worse than no rules. Agents follow them faithfully.
Who should use which
Use AGENTS.md alone if your team uses Codex, Cursor, Copilot or Gemini CLI and nobody uses Claude Code, or everyone is on a recent Claude Code and nobody keeps a CLAUDE.local.md.
Use CLAUDE.md alone if Claude Code is the only agent anyone uses and you want the user, org and local layers.
Use both with the import (our pick) if you have a mixed team, an open source repo, or you simply do not want to rewrite your rules when the next tool comes along.
If you are still choosing the agent itself, our comparisons of Kiro vs Claude Code, Claude Code vs GitHub Copilot and Claude CLI vs Claude Code cover the tools that read these files.
How we checked
We read the agents.md site, Anthropic's Claude Code memory docs and the Claude Code overview on 3 December 2026, and checked Kiro's home page for its AGENTS.md support. Version numbers and setting names are quoted from Anthropic's docs. We did not test every listed tool's AGENTS.md support ourselves; the list is the one agents.md publishes. Both formats are moving fast, so the official docs win if they disagree with us. More on how we pick.
Questions people ask
Does Claude Code read AGENTS.md?
Yes, from version 2.1.277 on, per Anthropic's memory docs. By default it reads AGENTS.md only when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your working directory or above it. If you have both, it reads CLAUDE.md only, unless you set Project instructions to claude-md-and-agents-md in /config.
Should I use CLAUDE.md or AGENTS.md?
If anyone on the team uses a coding agent other than Claude Code, put your rules in AGENTS.md, because many tools read it. Then add a CLAUDE.md that imports it with @AGENTS.md for anything Claude specific. If your team only ever uses Claude Code, a plain CLAUDE.md is fine and gives you imports, user and org levels.
Can I symlink CLAUDE.md to AGENTS.md?
Yes. Anthropic's docs show ln -s AGENTS.md CLAUDE.md as an option when you need no Claude specific content. The catch: Claude Code's edit tools refuse to write through a symlink and point Claude to edit AGENTS.md instead, and symlinks can behave differently on Windows checkouts. The @AGENTS.md import is the safer default.
Why is Claude ignoring my AGENTS.md?
The usual cause is a CLAUDE.md or CLAUDE.local.md somewhere in your working directory or above it. Either one makes Claude skip AGENTS.md by default. Add @AGENTS.md to that CLAUDE.md, or set Project instructions to claude-md-and-agents-md in /config. Older versions, before v2.1.277, do not read AGENTS.md at all.
What should go in AGENTS.md or CLAUDE.md?
The agents.md site suggests a project overview, build and test commands, code style, testing instructions and security notes. Anthropic suggests keeping each CLAUDE.md under 200 lines, because longer files use more context and get followed less well. Write things the agent cannot guess from the code: how to run tests, what never to touch, house rules.
How do nested AGENTS.md and CLAUDE.md files work in a monorepo?
For AGENTS.md, agents read the nearest file in the folder tree and the closest one wins, per agents.md. Claude Code loads every CLAUDE.md from your working directory up to the root and joins them, root first, and loads subfolder files when it works in that folder. Same idea, slightly different rules.
Sources
Every fact above comes from these pages. Prices change, so each one carries the date we read it.
- AGENTS.md official site, checked 3 Dec 2026
- Claude Code docs: How Claude remembers your project (CLAUDE.md and AGENTS.md), checked 3 Dec 2026
- Claude Code docs: Overview, checked 3 Dec 2026
- Kiro home page (lists AGENTS.md support), checked 3 Dec 2026