CLAUDE.md, AGENTS.md and Cursor rules all do the same job: they tell an AI coding tool how to work in your project. The difference is which tool reads which file. This guide shows the file each tool uses, how they compare, and how to keep one set of rules across Claude Code, Cursor, Codex, GitHub Copilot and Gemini CLI.
Quick answer: Claude Code reads CLAUDE.md, Codex reads AGENTS.md, Cursor reads .cursor/rules and also AGENTS.md, GitHub Copilot reads .github/copilot-instructions.md, and Gemini CLI reads GEMINI.md. Keep your shared rules in AGENTS.md and point the other files at it.
| Tool | Main file | Template |
|---|---|---|
| Claude Code | CLAUDE.md | CLAUDE.md template |
| Codex | AGENTS.md | AGENTS.md template |
| Cursor | .cursor/rules/*.mdc (also AGENTS.md) | Cursor rules template |
| GitHub Copilot | .github/copilot-instructions.md | GitHub Copilot templates |
| Gemini CLI | GEMINI.md | Gemini CLI templates |
CLAUDE.md
CLAUDE.md is the project guide Claude Code loads at the start of every session. It can live at the project root, in ~/.claude for personal rules, and in subfolders. It supports imports, so a line like @AGENTS.md pulls in your shared rules. Create one with the free CLAUDE.md generator.
AGENTS.md
AGENTS.md is an open format read by Codex and a growing list of agents, including Cursor. Agents use the AGENTS.md closest to the file they are editing, so a monorepo can have one per package. Because so many tools read it, it is the best home for rules you want everywhere. Start from the free AGENTS.md generator.
Cursor rules
Cursor project rules are .mdc files in .cursor/rules, each with a small header that says when it applies: always, for matching files, when relevant, or manually. The older single .cursorrules file still works but project rules are recommended. Generate one with the free Cursor rules generator.
Get ready design rules files for every tool, CLAUDE.md, AGENTS.md, Cursor rules, Copilot and GEMINI.md, plus 560+ design templates they point to.
Get a licencecopilot-instructions.md and GEMINI.md
GitHub Copilot reads .github/copilot-instructions.md for every chat and agent request in the repository, with optional path-specific files in .github/instructions. Gemini CLI reads GEMINI.md files from your home folder, the project and subfolders, and can be set to read AGENTS.md instead. Use the free copilot-instructions.md generator and GEMINI.md generator.
How to keep one set of rules for every tool
1. Put the shared rules, commands, code style and design rules, in AGENTS.md.
2. In CLAUDE.md, import it with @AGENTS.md and add only Claude-specific notes.
3. Cursor reads AGENTS.md already; add .cursor/rules only for rules scoped to certain folders.
4. For Copilot and Gemini CLI, point their files at AGENTS.md or keep a short copy in sync.
The rules matter less than the design they point to. Every file should name one design source, a template saved in your repo, so each tool builds pages that look like one product. Read more on Claude Code skills vs hooks vs subagents.
Frequently asked questions
What is the difference between CLAUDE.md and AGENTS.md?
They do the same job for different tools. Claude Code reads CLAUDE.md; Codex, Cursor and many other agents read AGENTS.md. You can import AGENTS.md into CLAUDE.md to share rules.
Does Cursor read AGENTS.md?
Yes. Cursor reads AGENTS.md at the project root alongside its own .cursor/rules files.
Does Cursor read CLAUDE.md?
No. Cursor uses .cursor/rules and AGENTS.md. Keep shared rules in AGENTS.md so both Claude Code and Cursor can use them.
Is .cursorrules deprecated?
It still works, but Cursor recommends project rules in .cursor/rules, which can be split by topic and scoped to files.
Which file should I create first?
AGENTS.md, because the most tools read it. Then add CLAUDE.md with an import if you use Claude Code.
What should these files contain?
Commands to run, code style, design rules with one design source, and how to finish a task. Keep them under about 100 lines.
Related templates
CLAUDE.md generator
Free starter CLAUDE.md for your stack.
AGENTS.md generator
Free starter AGENTS.md for any agent.
Cursor rules generator
Free .mdc project rule for Cursor.
CLAUDE.md template
Design rules for Claude Code.
Cursor rules template
Design rules for Cursor.
AGENTS.md template
Design rules for Codex and agents.

