Write a repo's agent instructions as one AGENTS.md, and skip a CLAUDE.md shim
Context#
A repo needs agent instructions that several harnesses read. Claude Code reads CLAUDE.md. Other harnesses read AGENTS.md.
Decision#
Write one AGENTS.md as the real file. Do not add a CLAUDE.md. Claude Code falls back to AGENTS.md when the directory has no CLAUDE.md and no CLAUDE.local.md. A session note gives version 2.1.277 as the first Claude Code version with this fallback. Add a CLAUDE.md that holds only the line @AGENTS.md (the import form Anthropic documents) in three cases: someone runs a Claude Code older than 2.1.277, the project needs lines that only Claude should read, or a CLAUDE.local.md exists. A CLAUDE.md that is not an import hides AGENTS.md from Claude. Merge its text into AGENTS.md, then delete it or turn it into the import. The user wants AGENTS.md as the real file, never CLAUDE.md as the source.
Why#
A CLAUDE.local.md in the directory blocks the fallback, so check for one. Two full copies drift within a week. A symlink also works, but it breaks on Windows and blocks edits made through it.
Rejected options#
Two copies of the text. A symlink from AGENTS.md to CLAUDE.md, or the reverse. CLAUDE.md as the source file.
Also found by searching
- should I keep both CLAUDE.md and AGENTS.md in the repo
- how do I make Claude Code read AGENTS.md
- CLAUDE.md symlink to AGENTS.md or the other way round
- one agent instructions file for Claude Code, pi and Codex