How to make one AGENTS.md file cover five coding agents
Based on a post by YH (@YH31377807) on X · Nov 27, 2026
You'll end with: One AGENTS.md that Claude Code, Codex, Cursor, Gemini CLI, and Copilot all follow, with CLAUDE.md cut to a one-line import.
Why it's worth having: When a repo holds both files, Claude Code reads only CLAUDE.md and skips AGENTS.md, and the one-line import closes that gap.
At a glance
The method, in short
- 1Put the shared rules in AGENTS.md, which Codex reads and stops loading at 32 KiB by default.
- 2Make CLAUDE.md one line, @AGENTS.md, since Claude Code reads AGENTS.md only when no CLAUDE.md exists.
- 3For Cursor, use .cursor/rules/*.mdc or AGENTS.md, since a plain .md file inside .cursor/rules is ignored.
- 4Add AGENTS.md to Gemini CLI with context.fileName in settings.json, and note that the Copilot cloud agent reads the nearest AGENTS.md.
Read the full guide from @YH31377807 on X
The post lists the instruction file each of the five agents reads and gives the one-line fix.