AGENTS.md vs CLAUDE.md
AGENTS.md is the shared instructions file that Codex, Cursor, OpenCode and many other coding agents read; CLAUDE.md is Claude Code's own. Since v2.1.277, Claude Code reads AGENTS.md too, but by default only when there is no CLAUDE.md in your working directory or above it.
What each file is
Both are Markdown files of plain instructions that a coding agent reads at the start of a session: build commands, test commands, conventions, the things a new colleague would need to be told. Neither is enforced configuration. The agent treats them as context.
AGENTS.md is an open format. Its site describes it as a README for agents, used by over 60,000 open-source projects, and lists Codex, Jules, Cursor, Gemini CLI, GitHub Copilot, Zed, Warp, Junie, opencode and others as tools that read it.
CLAUDE.md is Claude Code's format. It supports things AGENTS.md does not define: @path imports, a gitignored CLAUDE.local.md for personal notes, path-scoped rules in .claude/rules/, and an organisation-wide managed file.
Which file Claude Code reads
This is the default behaviour, from Claude Code's own documentation:
| Your repository has | Claude Code reads |
|---|---|
| An AGENTS.md, and no CLAUDE.md or CLAUDE.local.md in your working directory or above it | Your AGENTS.md |
| An AGENTS.md and a CLAUDE.md or CLAUDE.local.md in your working directory or above it | Your CLAUDE.md files only |
A CLAUDE.md that imports AGENTS.md with @AGENTS.md | Your CLAUDE.md, with AGENTS.md included through the import |
To change the default, open /config in a session and set Project instructions to claude-md-and-agents-md (both files, CLAUDE.md first), claude-md (CLAUDE.md only) or managed-only. The default is claude-md-or-agents-md.
Which one to use
It depends on how many tools read the repository.
| Your situation | What to do |
|---|---|
| Only Claude Code, now and later | Use CLAUDE.md. You get imports, local files and rules. |
| Several tools, nothing Claude-specific | Use AGENTS.md alone. Claude Code v2.1.277 and later reads it with no extra file. |
| Several tools, plus Claude-only instructions | Keep AGENTS.md, and add a CLAUDE.md that starts with @AGENTS.md and puts the Claude-only lines below it. |
| Several tools, and you want personal notes in CLAUDE.local.md | Set Project instructions to claude-md-and-agents-md, or the local file stops AGENTS.md loading. |
If you need no Claude-specific content, Claude Code's docs also allow a symlink: ln -s AGENTS.md CLAUDE.md.
The gotchas
- A
CLAUDE.local.mdcounts as a CLAUDE.md. Adding one for your own uncommitted notes turns AGENTS.md off for you, unless you change the Project instructions setting. - Claude Code does not read
AGENTS.local.md,AGENTS.override.md, or anything under a.agents/directory. - Before v2.1.277, or if the built-in plugin that reads AGENTS.md is disabled, Claude Code reads CLAUDE.md only. The first session after upgrading from v2.1.276 or earlier can also miss it.
- The built-in Explore and Plan subagents start without your project instructions, AGENTS.md included.
- Claude Code's docs suggest keeping each instructions file under 200 lines. Imports organise a long file but do not make it cheaper: imported files load with the file that imports them.
The OpenCode side
OpenCode reads AGENTS.md as its rules file, from the project and from ~/.config/opencode/AGENTS.md for personal rules across every project. For people moving from Claude Code it falls back to CLAUDE.md when a project has no AGENTS.md, and to ~/.claude/CLAUDE.md when there is no global AGENTS.md. Setting OPENCODE_DISABLE_CLAUDE_CODE=1 turns that compatibility off.
So a repository with one AGENTS.md and no CLAUDE.md is read the same way by both tools, which is the simplest set-up if your team uses both.
Where Luros fits
Neither file defines roles. Agents with a remit live elsewhere: .claude/agents/ for Claude Code and .opencode/agents/ for OpenCode. Luros writes twenty-six of them into both folders and leaves your AGENTS.md and CLAUDE.md alone.
We make Luros, so weigh this section accordingly. Everything above it stands on the sources below.
Luros is built for a founder with no marketing team, not for general agent set-up. If that is you, request an invite.
Request an inviteOne email. We will tell you when there is a place for you, and nothing else.
Questions people ask
- Does Claude Code read AGENTS.md?
- Yes, from v2.1.277, when there is no CLAUDE.md or CLAUDE.local.md in your working directory or above it. With a CLAUDE.md present it reads CLAUDE.md only, unless the CLAUDE.md imports AGENTS.md or you change the Project instructions setting.
- Can I keep both files?
- Yes. The usual pattern is an AGENTS.md for every tool and a CLAUDE.md whose first line is @AGENTS.md, with Claude-only instructions below it.
- How do I make Claude Code read both files?
- Set Project instructions to claude-md-and-agents-md in /config. Claude Code then reads each directory's CLAUDE.md files first and its AGENTS.md after them, and skips an AGENTS.md it has already loaded through an import or a symlink.
- Does OpenCode read CLAUDE.md?
- As a fallback. OpenCode reads AGENTS.md, and uses CLAUDE.md only when a project has no AGENTS.md.
- Should I symlink CLAUDE.md to AGENTS.md?
- Only if you have nothing Claude-specific to add. Claude Code's docs give the symlink as an option; an @AGENTS.md import does the same job and leaves room for Claude-only lines.
Related guides
- Claude Code agents vs skills
- OpenCode agents
- Claude Code marketing agents
- Every guide · Tool comparisons
Sources
- Claude Code docs: How Claude remembers your project, checked 25/11/2026
- OpenCode docs: Rules, checked 25/11/2026
- agents.md, the AGENTS.md format site, checked 25/11/2026
Tools in this area change quickly. Every fact here comes from the sources above as they stood on the date shown; if one has moved on, the source is right and this page is out of date.