Guide
Does Claude Code support AGENTS.md?
Last updated
Yes. Claude Code reads AGENTS.md as your project instructions from version 2.1.277, released September 18, 2026. By default it reads AGENTS.md only when there is no CLAUDE.md or CLAUDE.local.md in your working folder or any folder above it. If a CLAUDE.md is there, Claude Code reads that instead, unless the CLAUDE.md imports AGENTS.md or you change the Project instructions setting.
When Claude Code reads AGENTS.md
The Claude Code documentation gives this table for the default setting:
| Your repository has | Claude reads |
|---|---|
| An AGENTS.md, and no CLAUDE.md or CLAUDE.local.md in your working folder or above it | Your AGENTS.md |
| An AGENTS.md and a CLAUDE.md or CLAUDE.local.md in your working folder or above it | Your CLAUDE.md files only |
A CLAUDE.md that contains @AGENTS.md | Your CLAUDE.md, with AGENTS.md included through the import |
Only some files count for that check. These stop Claude Code from reading AGENTS.md: a CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your working folder or any folder above it. These do not count, and keep loading alongside AGENTS.md: your personal ~/.claude/CLAUDE.md, your organization's managed CLAUDE.md, and files in .claude/rules/.
One trap: CLAUDE.local.md counts. If a project relies on AGENTS.md and you add a CLAUDE.local.md for your own notes, Claude Code stops reading AGENTS.md for you. The fix is the claude-md-and-agents-md setting below.
Which AGENTS.md files load, including nested ones
When no CLAUDE.md counts, Claude Code reads:
- At session start: every
AGENTS.mdand.claude/AGENTS.mdin your working folder and the folders above it. In an interactive session you see a line such asno CLAUDE.md found; AGENTS.md loaded: /home/you/repo/AGENTS.md. - Later, in subfolders: a subfolder's AGENTS.md, once Claude opens a file in that subfolder with the Read tool, as long as that subfolder has no CLAUDE.md files of its own.
- Imports inside AGENTS.md:
@pathimports are expanded, as in CLAUDE.md, andclaudeMdExcludespatterns apply.
Claude Code does not read AGENTS.local.md, AGENTS.override.md (a Codex file name), or anything under a .agents/ folder.
Change which files load
Type /config in a Claude Code session and set Project instructions to one of these values:
claude-md-or-agents-md: CLAUDE.md, or AGENTS.md when there is no CLAUDE.md. This is the default.claude-md-and-agents-md: both files. In each folder, CLAUDE.md comes first and AGENTS.md after it. An AGENTS.md that CLAUDE.md already imports or links to is not read twice.claude-md: CLAUDE.md files only.managed-only: only your organization's managed CLAUDE.md and auto memory at launch.
You can also set it in ~/.claude/settings.json. Claude Code ignores this entry in a project's settings files:
{
"pluginConfigs": {
"cc-plugin-agents-md@builtin": {
"options": { "instructionFiles": "claude-md-and-agents-md" }
}
}
}
Before version 2.1.285 the plugin ID was agents-md@builtin. Version 2.1.285 and later accept either ID.
When Claude Code can't read AGENTS.md
In these cases Claude Code reads CLAUDE.md only, and Project instructions is missing from /config:
- You run a version before 2.1.277. Check with
claude --version. - You turned off the built-in AGENTS.md plugin with
/plugin. - In some cases, the first session after upgrading from 2.1.276 or earlier. It works from the next session.
Before version 2.1.281, some sessions, such as those on Amazon Bedrock or with telemetry turned off, also read CLAUDE.md only. Update Claude Code to fix that. In any of these cases, import AGENTS.md from a CLAUDE.md.
Share one AGENTS.md between Claude Code, Codex and Cursor
Codex reads AGENTS.md. Cursor reads AGENTS.md in the project root and in subfolders. So AGENTS.md is the natural file to share. You have three ways to make Claude Code use it too.
1. AGENTS.md only. On Claude Code 2.1.277 or later, with no CLAUDE.md in the project, nothing else is needed. This is the simplest choice when everyone on the team runs a current version.
2. A CLAUDE.md that imports AGENTS.md. Put this in CLAUDE.md next to AGENTS.md:
@AGENTS.md
## Claude Code
Use plan mode for changes under `src/billing/`.
Claude reads the imported file first, then the rest. Choose this when you have instructions only Claude Code should see, or when some people run a version that can't read AGENTS.md directly. Imports can nest up to four hops.
3. A symlink. Run ln -s AGENTS.md CLAUDE.md. Choose this only if you need no Claude-specific content and nobody works on Windows. Creating a symlink on Windows needs Administrator rights or Developer Mode, and Git checks a committed symlink out as a plain text file unless core.symlinks is on. That leaves a one-line CLAUDE.md in place of your instructions. Claude Code's Edit and Write tools also refuse to write through a symlink and edit AGENTS.md instead.
With options 2 and 3, run /context all in your next session and check that CLAUDE.md appears under Memory files.
If you set up a workaround before 2.1.277, review it. A SessionStart hook that prints AGENTS.md now adds a second copy, so remove it. A CLAUDE.md that only says "read AGENTS.md" in words depends on Claude choosing to open the file; replace the sentence with @AGENTS.md or delete the CLAUDE.md. An existing @AGENTS.md import or symlink never loads the file twice.
Codex does not read CLAUDE.md by default. If your instructions live in CLAUDE.md, you can list it in project_doc_fallback_filenames in ~/.codex/config.toml, which Codex tries when a folder has no AGENTS.md. For how Codex finds and combines its files, see what AGENTS.md is and how Codex reads it.
Share memory between Claude Code and Codex
AGENTS.md and CLAUDE.md hold rules that every task needs, and both agents load them in full each session. Notes that grow over time, such as past decisions and fixes, fit better in a memory the agents search. Claude Code and Codex can both connect to the same Memlo account over MCP, so a decision saved in one is found by the other. See how to share one memory between Claude Code, Codex and other agents and how to give Claude Code memory between sessions.
Frequently asked questions
Does Claude Code read AGENTS.md if there is also a CLAUDE.md?
Not by default. With a CLAUDE.md or CLAUDE.local.md in your working folder or above it, Claude Code reads CLAUDE.md only. Add @AGENTS.md to the CLAUDE.md, or set Project instructions to claude-md-and-agents-md in /config.
Since which version does Claude Code support AGENTS.md?
Version 2.1.277, from September 18, 2026. The changelog entry says: "in a project with no CLAUDE.md, Claude Code reads AGENTS.md instead".
Does Claude Code read AGENTS.md in subfolders?
Yes. A subfolder's AGENTS.md loads when Claude opens a file in that subfolder, unless the subfolder has its own CLAUDE.md.
Should I use CLAUDE.md or AGENTS.md?
If you also use Codex, Cursor or other agents, keep shared rules in AGENTS.md and import it from a CLAUDE.md only when you need Claude-specific lines. If you only use Claude Code, CLAUDE.md works the same. See what CLAUDE.md is and what to put in it.
Does /init use my AGENTS.md?
With CLAUDE_CODE_NEW_INIT=1 set, /init reads AGENTS.md and adds the relevant parts to the CLAUDE.md it writes. /import appends a one-time copy of AGENTS.md to the matching CLAUDE.md.
Sources
Checked on November 18, 2026:
- How Claude remembers your project, Claude Code documentation (AGENTS.md section)
- Claude Code changelog, versions 2.1.277 and 2.1.281
- Glossary: AGENTS.md, Claude Code documentation
- Custom instructions with AGENTS.md, Codex documentation
- Rules, Cursor documentation
Give every agent the same memory
Ask your agent to add Memlo, or get started below. Memlo is invitation only for now.
Memlo is invitation only for now. We'll email you when your invitation is ready.
By joining, you agree to our Privacy Policy and to occasional emails from us about Memlo. Unsubscribe anytime.