Home › Rules › AGENTS.md vs CLAUDE.md
AGENTS.md vs CLAUDE.md: which one do you need?
Short answer: write one AGENTS.md. If you use Claude Code too, either let it read AGENTS.md directly or add a one-line CLAUDE.md that imports it. Don't maintain two copies.
The difference
| AGENTS.md | CLAUDE.md | |
|---|---|---|
| Who reads it | Many tools: OpenAI Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (now Devin Desktop), Zed, Aider and others listed on agents.md. Claude Code too, in some cases (below). | Claude Code. GitHub Copilot also reads it in some surfaces. |
| Format | Plain Markdown, no required fields | Plain Markdown, plus @path imports |
| Locations | Repo root, plus optional nested files in subfolders | ./CLAUDE.md or ./.claude/CLAUDE.md, personal ~/.claude/CLAUDE.md, private CLAUDE.local.md |
| Who maintains it | An open format, stewarded by the Agentic AI Foundation (Linux Foundation) | Anthropic |
How Claude Code handles AGENTS.md
Per Anthropic's docs (Claude Code v2.1.277 or later):
- Only AGENTS.md in the project: Claude reads it.
- Both AGENTS.md and CLAUDE.md (or CLAUDE.local.md): by default Claude reads only the CLAUDE.md files. You can change this with the Project instructions setting in
/config. - CLAUDE.md that imports AGENTS.md: Claude reads both, with no double-loading.
That middle case catches people: adding a personal CLAUDE.local.md quietly stops Claude from reading your shared AGENTS.md. The import avoids it.
Make Claude Code read both files (the /config setting)
Type /config in a Claude Code session and set Project instructions to one of these:
| Value | What Claude reads |
|---|---|
claude-md-or-agents-md | The default. Your CLAUDE.md files, or AGENTS.md when there's no CLAUDE.md or CLAUDE.local.md in your folder or above it. |
claude-md-and-agents-md | Both. Each folder's CLAUDE.md first, then its AGENTS.md. An AGENTS.md you already import isn't read twice. Pick this if you keep a CLAUDE.local.md. |
claude-md | CLAUDE.md files only. |
managed-only | Only your organization's managed CLAUDE.md (plus auto memory). |
To set it once for every project, put this in ~/.claude/settings.json (Claude Code ignores it in a project's settings file):
{
"pluginConfigs": {
"cc-plugin-agents-md@builtin": {
"options": { "instructionFiles": "claude-md-and-agents-md" }
}
}
}
Claude Code never reads AGENTS.local.md, AGENTS.override.md (that one is Codex's) or anything under .agents/.
AGENTS.md not loading in Claude Code? Check these 3 things
- A CLAUDE.md is in the way. Look for
CLAUDE.md,.claude/CLAUDE.mdorCLAUDE.local.mdin your folder or any folder above it (your personal~/.claude/CLAUDE.mddoesn't count). Add@AGENTS.mdto it, or switch the setting toclaude-md-and-agents-md. - Old version. Run
claude --version. Reading AGENTS.md directly needs v2.1.277 or later, and v2.1.281 or later for every session type. - The setting is off. In
/config, make sure Project instructions isn'tclaude-mdormanaged-only. If the setting isn't there at all, that session can't read AGENTS.md, so import it from a CLAUDE.md.
To check, run /memory and look for your AGENTS.md path in the list.
The setup we recommend
# AGENTS.md
(your shared rules: project, commands, rules, how to work)
Free rules starter pack for Cursor, Claude Code, Codex and Antigravity
One shared AGENTS.md that works across Cursor, Claude Code, Codex, Copilot and Antigravity, plus database and test rules in each tool's format. Unzip it into your project and fill in two sections. I'll email you the link.
Free. No spam. Unsubscribe anytime. See our privacy note.
@AGENTS.md
## Claude Code
- Use plan mode before any change that touches more than 3 files.
A symlink (ln -s AGENTS.md CLAUDE.md) also works, but Anthropic's docs recommend the import if anyone on the project uses Windows, where Git may check symlinks out as plain text files.
Matching kit: Vibe Coder Skills Pack ($9)
The free rules set the boundaries. The Skills Pack adds 6 ready-to-copy skills for when a project goes wrong: stop-the-loop, fix-one-bug, leak-check, ship-check, explain-project and builder-handoff, for Claude Code, Cursor and Codex, with paste-in steps for Lovable, Bolt, Replit and Base44.
See the Vibe Coder Skills Pack ($9) →
Instant download. 7-day refund, no questions asked.
When CLAUDE.md alone is fine
You only ever use Claude Code, and you want Claude features like @ imports of other docs. Even then, naming the file AGENTS.md costs nothing and keeps your options open if you try Codex or Cursor later.
Get a ready-made file
Every file in the rules library comes as AGENTS.md with the CLAUDE.md import ready to copy. Or generate a CLAUDE.md for your project. Want filled-in examples? See CLAUDE.md examples and best practices and AGENTS.md examples. Still picking a tool? See Cursor vs Claude Code vs Codex for beginners (real prices).
Best value
All 6 kits for $29 — or $20.30 with code WELCOME30 (through Nov 30)
All six kits in one download: Tiny Game Builder Kit, Inbox Triage Agent, Codebase Fixer Agent, MVP Spec-to-Build Pack, Discord Bot Builder and the Vibe Coder Skills Pack. The five build kits are one markdown file each (agent brief, setup steps, worked example); the Skills Pack adds a zip of 6 SKILL.md skill folders.
Get all 6 kits for $29 → See what's in each kit
$29 instead of $48 for the six kits bought separately; WELCOME30 takes 30% off that at checkout ($20.30). Instant download from Gumroad. 7-day refund, no questions asked.