AGENTS.md vs CLAUDE.md
What is the difference between AGENTS.md and CLAUDE.md, and how do you sync them?
They are not the same file. Codex and many other agents read AGENTS.md. Claude Code reads CLAUDE.md. The text can match, but each tool looks up its own name. To keep them in sync, put the rules only in AGENTS.md and make CLAUDE.md a one-line import: @AGENTS.md. Edit the source file after that. Do not paste the rules into both.
Sync AGENTS.md and CLAUDE.md
Write the rules once. AGENTS.md is the source. CLAUDE.md is only @AGENTS.md, so Claude Code imports it instead of keeping a second copy.
AGENTS.md
Save this at the repo root. This is the file you edit.
# Project rules - Read the files you will change before editing them.- Match the patterns already in the repo.- Do not add dependencies the task did not ask for. CLAUDE.md
Save this at the repo root. Claude Code imports the source file.
@AGENTS.md Questions
Does AGENTS.md need YAML frontmatter?
No. AGENTS.md is plain Markdown. Frontmatter is for Cursor .mdc rules. An empty AGENTS.override.md in a folder hides the real file from Codex, so do not create that file unless you mean to.
Will Claude Code follow @AGENTS.md?
Yes. A line in CLAUDE.md that starts with @ imports that file at the start of the session. @AGENTS.md pulls in the root file. Change the rules in AGENTS.md, then start a new Claude session.