AGENTS.md vs CLAUDE.md: which file each coding agent reads, and how to keep one
You run Claude Code and Codex on the same repo, and each one seems to follow different rules.
Codex reads AGENTS.md files before doing any work, per OpenAI's Codex guide. Claude Code can read AGENTS.md as your project instructions, but by default only when you have no CLAUDE.md in your working directory or above it, per Anthropic's memory docs. So if your repo has both files, by default Claude reads your CLAUDE.md files only. In our view, the fix most repos want is to keep the shared rules in AGENTS.md, and put an @AGENTS.md import in a CLAUDE.md next to it.
Typed the same correction into both agents last week? Download ReMynd
What is AGENTS.md?
The agents.md site calls it "a simple, open format for guiding coding agents." In practice it's a README written for agents: one predictable file where you put the context and instructions they need to work on your project.
- It's not tied to one vendor. The site says they chose a name and format that could work for anyone, rather than introducing another proprietary file.
- It holds agent detail. Build steps, tests, and conventions that might clutter a README or aren't relevant to human contributors.
What is CLAUDE.md?
Anthropic's Claude Code memory docs say CLAUDE.md files are markdown files that give Claude persistent instructions for a project, your personal workflow, or your entire organization. Claude reads them at the start of every session.
- Where they live. A project file sits at ./CLAUDE.md or ./.claude/CLAUDE.md, your personal file at ~/.claude/CLAUDE.md, and personal project preferences at ./CLAUDE.local.md.
- They're context, not config. The docs say Claude treats CLAUDE.md files and auto memory as context. They aren't enforced configuration.
Which file does each agent read?
In each of these setups Codex reads AGENTS.md, unless an AGENTS.override.md sits in the same directory, while Claude Code's default depends on whether a CLAUDE.md exists.
| Your repo has | Codex reads | Claude Code reads by default |
|---|---|---|
| AGENTS.md only | AGENTS.md | Your AGENTS.md |
| AGENTS.md and CLAUDE.md | AGENTS.md | Your CLAUDE.md files only |
| CLAUDE.md that imports AGENTS.md | AGENTS.md | Your CLAUDE.md, with AGENTS.md included through the import |
The Claude Code column comes from Anthropic's docs, and reading AGENTS.md directly requires Claude Code v2.1.277 or later. The Codex column comes from OpenAI's AGENTS.md guide, which says Codex checks AGENTS.override.md, then AGENTS.md, then any fallback names in project_doc_fallback_filenames. Filenames not on this list are ignored for instruction discovery. Both columns reflect the docs as checked on December 3, 2026.

Which instruction file Codex and Claude Code read by default, and how one AGENTS.md can serve both. Illustration by ReMynd.
How Codex reads AGENTS.md
OpenAI's guide says Codex builds an instruction chain when it starts, once per run.
- Global first. In your Codex home directory, Codex reads AGENTS.override.md if it exists. Otherwise, Codex reads AGENTS.md.
- Then the project. Starting at the project root, Codex walks down to your current working directory, and includes at most one file per directory.
- Closer wins. Files closer to your current directory override earlier guidance because they appear later in the combined prompt.
- There's a size cap. Codex stops adding files once the combined size reaches the limit defined by project_doc_max_bytes (32 KiB by default).
How Claude Code reads AGENTS.md
By default, Claude reads AGENTS.md only when you have no CLAUDE.md in your working directory or above it. A CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md there counts for that check. Your ~/.claude/CLAUDE.md, your organization's managed CLAUDE.md, and .claude/rules/ files don't count, and keep loading alongside AGENTS.md.
- Watch CLAUDE.local.md. The docs say adding one in a project that relies on AGENTS.md stops Claude from reading AGENTS.md for you.
- You can change the default. Type /config in a Claude Code session, then set Project instructions. The claude-md-and-agents-md value loads your CLAUDE.md and AGENTS.md files together.
- Some files aren't read. AGENTS.local.md, AGENTS.override.md, or anything under a .agents/ directory.
How to keep one file for both agents
Anthropic's docs give the pattern: when Claude isn't reading your AGENTS.md directly, you can still keep it as the one file every tool shares by putting an @AGENTS.md import in a CLAUDE.md next to it.
```markdown @AGENTS.md
Claude Code
- Claude-specific notes go below the import.
```
- No double loading. The docs say keeping the import never makes Claude read AGENTS.md twice, whichever Project instructions value you use.
- Don't just ask in words. A CLAUDE.md that tells Claude in words to read AGENTS.md means Claude sees AGENTS.md only if it decides to open the file. Use the @AGENTS.md import instead.
- Drop old hooks. If a SessionStart hook prints AGENTS.md, the docs say to remove it, since once Claude reads AGENTS.md directly, the hook adds a second copy to the context.
A simple decision path
Stop at the first step that fits your repo.
- Only AGENTS.md? Codex reads it, and by default so does Claude Code on the version above. In some sessions Claude can't read AGENTS.md, so import it from a CLAUDE.md there.
- Both files? Move shared rules into AGENTS.md and make CLAUDE.md start with @AGENTS.md.
- Added CLAUDE.local.md? Set Project instructions so Claude reads both files, or Claude stops reading AGENTS.md.
- Codex follows the wrong rules? Look for an AGENTS.override.md higher in the directory tree or under your Codex home.
- Rules keep going stale? Update the one shared file when an agent makes the same mistake a second time.
Where ReMynd fits
ReMynd is a desktop app that gives your computer local photographic memory, for you and your AI agents. It locally captures your screen history and keeps the searchable index on your computer.
In our view, the hard part of a good AGENTS.md is remembering what you had to correct. If you typed a correction into a Claude Code or Codex chat in the window you were working in, starting from install, you can search for a word from it and copy the rule into the shared file. ReMynd doesn't edit either file.
On a Mac, ReMynd needs screen recording permission, which Apple's guide puts in System Settings under Privacy & Security, Screen & System Audio Recording.
For keeping CLAUDE.md itself current, see how to update CLAUDE.md. When a long session forgets those rules, Claude Code compact covers what survives. If the agent keeps repeating a failed fix, see Claude Code keeps suggesting the fix I already tried. For Codex's own memory, see Codex memories in the ChatGPT desktop app. For the wider engineering setup, see ReMynd for engineers.
Your screen history is stored on your computer by default, and nothing is uploaded to us unless you turn on optional cloud sync. You can pause capture or block any app or site. That's how ReMynd's own pages put it, as of December 2026.
Honest limits
- ReMynd doesn't read, write, or sync AGENTS.md or CLAUDE.md.
- ReMynd captures only what is on your screen, starting from install. It cannot recover past work, and it cannot see background or cloud agents.
- Text recognition reads the window you're working in, so text in a window behind it won't be searchable by its words.
- On a Mac, ReMynd needs Apple silicon and macOS 15 or later. ReMynd also runs on Windows 11 (x64 or arm64).
The short version
Codex reads AGENTS.md, and Claude Code reads it too, but by default only when there's no CLAUDE.md. Keep shared rules in AGENTS.md and import it from CLAUDE.md. For the bigger picture, giving an AI coding agent memory of your actual work is the next read.
Want the corrections you typed to stay findable? Download ReMynd