Does Claude Code read AGENTS.md? Import it via CLAUDE.md.
No—not as a top-level file. Claude Code reads CLAUDE.md; put @AGENTS.md there to import the shared contract, then verify the load in a fresh session.
Published August 5, 2026 · Updated September 12, 2026The direct answer
No—not directly. Claude Code discovers CLAUDE.md. To share rules with other coding agents, keep the contract in AGENTS.md and import it from CLAUDE.md with @AGENTS.md.
Put the shared project instructions in AGENTS.md. Then create a CLAUDE.md beside it whose first line is @AGENTS.md. Claude Code expands that import when the session starts, and you can keep a small Claude-only overlay underneath it.
@AGENTS.md
## Claude Code only
- Use plan mode before changing more than three files.
- Put temporary notes in CLAUDE.local.md.This is not a naming trick. Claude Code's current documentation explicitly says it reads CLAUDE.md, not AGENTS.md, and recommends importing AGENTS.md when a repository supports other coding agents.
See the smallest working pair
This is the complete cross-tool shape: shared rules live once, and the Claude file needs only the import. A Claude-only overlay is optional. Replace the example commands with the ones your repository actually runs.
# Shared project contract
## Quality gate
- Run pnpm test before finishing.
- Never commit secrets or .env files.@AGENTS.mdVerify the import in a fresh Claude Code session with /context before trusting the pair in a real task.
Do you actually need to sync two files?
If CLAUDE.md already contains only @AGENTS.md, your shared rules already have one source. Edit AGENTS.md; there is no copied rule body to sync. If you use only Claude Code, keeping your existing standalone CLAUDE.md is also reasonable. You do not need a second file just to use this tool.
Use the comparison mode when you already have two independent files or a Claude-only overlay to review. Back up the originals and review every retained rule before replacing either file.
Choose one setup
Import AGENTS.md
Use @AGENTS.md in CLAUDE.md. It works across operating systems and leaves room for a short Claude-specific overlay.
Symlink CLAUDE.md
Point CLAUDE.md to AGENTS.md only when both files must stay byte-for-byte identical. Windows may require Developer Mode or administrator privileges, so this is less portable for a team.
Copy the same prose twice
Two independent files eventually disagree on commands, paths, or safety rules. Duplication is the failure mode the import pattern removes.
Set it up and verify the load
- Make AGENTS.md the shared contract.
Keep build commands, project structure, quality gates, safety boundaries, and the definition of done here. Do not put personal preferences in the committed shared file.
- Import it from CLAUDE.md.
Add
@AGENTS.mdas plain text, outside backticks and fenced code blocks. Relative imports resolve from the directory containing theCLAUDE.mdfile. - Verify a new Claude Code session.
Run
/contextand confirm thatCLAUDE.mdappears under Memory files. Ask Claude to state the repository's documented test command, then compare the answer with the shared file.
Loaded does not mean enforced
/context can confirm loaded memory files. A correct answer about a test command alone cannot prove which file supplied it: parent instructions, user memory, or files read during the task may contain the same fact.
For a manual check, use a disposable project with a harmless, distinctive fact in AGENTS.md, start a fresh session, inspect Memory files, and ask for that fact before asking Claude to read any files. Check applicable parent and user instructions too. Treat the answer as supporting evidence, not a guarantee that future tasks will obey every rule.
The examples here are illustrative. We have checked the local generator and official documentation; we have not run this walkthrough in a Claude Code session for this revision. This website cannot inspect your Claude Code session.
Use the same pattern in a monorepo
A root import only points at the root AGENTS.md. When a package has a narrower AGENTS.md, put a small CLAUDE.md beside that file and import the local target. Claude Code discovers nested CLAUDE.md files when it works with files in those directories.
repo/
├── AGENTS.md
├── CLAUDE.md # @AGENTS.md
└── packages/api/
├── AGENTS.md
└── CLAUDE.md # @AGENTS.mdKeep the nested file focused on that package. Shared rules should remain at the root so every agent receives the same baseline without repeated prose.
Download a clean starter pair
These plain Markdown files are deliberately small. Replace the TODO lines with repository facts, commit the shared contract, and keep the Claude overlay limited to real Claude-specific preferences.
If the import is not working
- Check the exact file name and case:
AGENTS.md. - Keep
@AGENTS.mdoutside inline code and fenced code blocks. - Resolve the path relative to the
CLAUDE.mdthat contains it. - Keep recursive imports within Claude Code's documented four-hop limit.
- Start a new session and use
/contextto inspect loaded memory files. - Remember that Markdown instructions guide behavior; use hooks, permissions, CI, and branch protection for enforced controls.
What this browser checker can verify
For same-directory files, it detects exact @AGENTS.md and @./AGENTS.md references in ordinary text, including prose. An example inside backticks, a fenced block, an indented code block, or an HTML comment is not treated as a confirmed import.
Other paths, nested Markdown edge cases, recursive imports, filesystem casing, and the files actually loaded by Claude need manual verification. The checker never runs Claude Code or resolves your repository paths.
If you supply an import without its target file, output is blocked. If you add an import to a standalone CLAUDE.md, its complete original body is retained. The tool does not decide which repeated or contradictory rules to delete.
Download and run the 22 regression fixtures, including a fenced import example, a missing target, and case-sensitive paths. The published reference implementation matches the website checker; this evidence tests the website, not Claude Code.
Sources and maintenance
The import behavior, relative-path resolution, recursion limit, AGENTS.md recommendation, and /context check come from the official Claude Code memory documentation. The shared-file convention is documented at agents.md. The Claude Code memory documentation was rechecked on September 12, 2026; agents.md was checked on August 5, 2026. Provider behavior can change.
Need a broader repository review? Use the 18-point AGENTS.md and CLAUDE.md audit checklist.
Check the files before you commit them
AgentsMD Checker compares the shared contract and Claude overlay in your browser, suggests lines to review, and prepares a content-preserving pair without uploading their contents.
Compare CLAUDE.md and AGENTS.md