Skip to content
Agent Friendly Code

AGENTS.md vs CLAUDE.md: which one should you use?

Use AGENTS.md, and if anyone uses Claude Code, add a CLAUDE.md that imports it with @AGENTS.md: Claude Code reads AGENTS.md only when there is no CLAUDE.md. 243 of 434 popular repos (56%) have an AGENTS.md; 17 have only a CLAUDE.md.

Both are plain Markdown with the same content. AGENTS.md is the open format most agents read; CLAUDE.md is Claude Code's name for it.

By Himanshu Singh · Updated · How we score →

Which agents read AGENTS.md and which read CLAUDE.md?

Whether each AI coding agent reads AGENTS.md and CLAUDE.md
AgentAGENTS.mdCLAUDE.md
Claude CodeWhen there is no CLAUDE.mdYes
CursorYesYes
DevinYesYes
CodexYesNo
Kimi Code CLIYesNo
Gemini CLIWhen configured toNo
AiderWhen configured toNo
OpenHandsYesYes
PiYesYes
GitHub CopilotCloud agent, code review, CLI and VS CodeYes
Google AntigravityYes, with GEMINI.mdNo
OpenCodeYes, CLAUDE.md as fallbackYes
Devin Desktop (formerly Windsurf)Yes, always onNo
KiroYes, always includedNo

Every file each agent reads, with links to their docs.

What does Claude Code do when a repo has both?

  • AGENTS.md onlyAGENTS.md
  • AGENTS.md and CLAUDE.mdCLAUDE.md only
  • AGENTS.md, and a CLAUDE.md that imports it with @AGENTS.mdBoth

Needs Claude Code v2.1.277 or later. A .claude/CLAUDE.md or CLAUDE.local.md counts as a CLAUDE.md. Run /memory to see what loaded.

How do I keep one file for both?

A CLAUDE.md that imports AGENTS.md

The setup Anthropic's docs recommend. Works on every OS, and leaves room for Claude-only notes under the import.

CLAUDE.md

@AGENTS.md

## Claude Code only
- Run /memory to check both files loaded.

39 repos, including n8n-io/n8n, Significant-Gravitas/AutoGPT, langflow-ai/langflow.

CLAUDE.md as a symlink

One file on disk. But Claude's Edit and Write tools won't write through a symlink, and Git checks it out as a plain text file on Windows unless core.symlinks is on.

Terminal

ln -s AGENTS.md CLAUDE.md
git add CLAUDE.md

35 repos, including huggingface/transformers, pytorch/pytorch, oven-sh/bun.

Two separate files

Claude Code reads only CLAUDE.md, most other agents only AGENTS.md, and the two drift apart. Only worth it when the content really differs.

18 repos, including firecrawl/firecrawl, ollama/ollama, ggml-org/llama.cpp.

Which setup does a repo use?

git ls-files | grep -iE '(^|/)(AGENTS|CLAUDE)\.md$'
ls -l CLAUDE.md    # CLAUDE.md -> AGENTS.md: a symlink
head -1 CLAUDE.md  # @AGENTS.md: an import

What do popular repos do?

On 16 Nov 2026 we read the whole file tree of 388 GitHub repos on our board. 107 had only a root AGENTS.md, 18 only a root CLAUDE.md, and 92 both: 39 import AGENTS.md from CLAUDE.md, 35 use a symlink and 18 keep two separate files.

Our AGENTS.md check passes either name; the choice only changes which agents find it. Read both kinds in popular repos. For other agents: Cursor rules vs AGENTS.md, GEMINI.md vs AGENTS.md.

Questions people ask

Can Claude Code read both files without an import?
Yes: set Project instructions in /config to claude-md-and-agents-md. It is a user setting, ignored in a repo's project settings, so it changes only your machine; the import fixes it for everyone who clones the repo.
Does CLAUDE.local.md count as a CLAUDE.md?
Yes. A CLAUDE.local.md or .claude/CLAUDE.md in the working directory or above it also stops Claude Code reading AGENTS.md, even when the repo has no CLAUDE.md.
Does Codex read CLAUDE.md?
Not by default. Codex reads AGENTS.md, and another name only when it is listed in project_doc_fallback_filenames in its config.
Does Gemini CLI read either file?
Neither, by default: it reads GEMINI.md. List AGENTS.md in context.fileName, or make GEMINI.md the line @AGENTS.md.

From the docs: code.claude.com/memory (new tab) · agents.md (new tab) · learn.chatgpt.com/agents-md (new tab) · cursor.com/rules (new tab) · docs.github.com/custom-instructions-support (new tab) · geminicli.com/gemini-md (new tab) · docs.devin.ai/agents-md (new tab) · git-scm.com/git-config (new tab)