
TL;DR
|
AGENTS.md, CLAUDE.md, and .cursorrules are all plain text files that tell AI coding agents how to work on your project. They differ in who reads them: AGENTS.md is an open format many tools share, CLAUDE.md is for Claude Code, and .cursorrules is Cursor's older, now deprecated format.
If your team uses more than one AI coding tool, you've probably found several of these in the same repository, each slightly different from the others. This guide explains what each file is, which tools read which, and how to set things up so you maintain one set of instructions instead of three.
Key takeaway: AGENTS.md is the shared format, CLAUDE.md and Cursor's rules are tool-specific, and .cursorrules is legacy.
| File | Read by | Where it lives | Status |
|---|---|---|---|
| AGENTS.md | Many coding agents, including Codex, Copilot's coding agent, Cursor, Claude Code, Jules, and Junie | Repository root, plus subfolders in larger projects | Open standard, stewarded by the Agentic AI Foundation |
| CLAUDE.md | Claude Code | Repository root, subfolders, or your home folder for personal instructions | Current |
| .cursor/rules/*.mdc | Cursor | A .cursor/rules/ folder in the repository | Current Cursor format |
| .cursorrules | Cursor | Repository root | Legacy. Still supported, but deprecated |
| .github/copilot-instructions.md | GitHub Copilot | The .github folder | Current |
| GEMINI.md | Gemini CLI | Repository root | Current |
Key takeaway: AGENTS.md gives teams one instruction file that many coding agents can read, instead of a separate file for every tool.
Early on, each AI coding tool asked for its own file. A team using two or three tools kept several copies of the same instructions, and the copies drifted apart.
AGENTS.md was released in the second half of 2025 as a single, vendor-neutral answer. According to the official site, it came out of a joint effort between OpenAI's Codex team, Amp, Google's Jules, Cursor, and Factory. The idea was deliberately simple: one predictable file name, plain Markdown, and no required structure.
In December 2025, OpenAI contributed AGENTS.md to the newly formed Agentic AI Foundation, part of the Linux Foundation, so no single company controls the format. The official site reports that more than 60,000 open source projects on GitHub include an AGENTS.md file.
Support changes quickly, so check your tool's documentation. As of October 2026:
| Tool | Reads AGENTS.md? |
|---|---|
| OpenAI Codex | Yes |
| GitHub Copilot coding agent | Yes |
| Cursor | Yes |
| Google Jules | Yes |
| Windsurf and Devin (Cognition) | Yes |
| JetBrains Junie | Yes |
| Zed, goose, opencode, Amp, Factory | Yes |
| Claude Code | Yes, since version 2.1.277 (September 2026), when the folder has no CLAUDE.md. If both exist, it uses CLAUDE.md by default, and a setting can make it read both |
| Gemini CLI | With a setting: point its context file name at AGENTS.md |
| Aider | With a setting: add AGENTS.md to its read list |
Key takeaway: CLAUDE.md is Claude Code's instruction file. It can import AGENTS.md, so shared instructions live in one place.
CLAUDE.md does for Claude Code what AGENTS.md does for many tools. Claude Code reads a CLAUDE.md in your repository, and can also read a personal one in your home folder for preferences that apply to all your projects, as described in the Claude Code documentation.
Two details matter if you also use other tools:
Claude Code's /init command can generate a CLAUDE.md by reading your project. Treat the result as a first draft to cut down, for reasons the research section below explains.
Key takeaway: .cursorrules is deprecated. Cursor now uses .mdc files in .cursor/rules/, and also reads AGENTS.md.
.cursorrules was Cursor's original instruction file: a single file at the repository root, applied to every request. Cursor's documentation now lists it as legacy, still supported but deprecated, and recommends Project Rules instead.
| .cursorrules (legacy) | Project Rules (.cursor/rules/*.mdc) | AGENTS.md in Cursor | |
|---|---|---|---|
| Format | Plain text | Markdown with a short settings header | Plain Markdown |
| Number of files | One | As many as you like | One at the root, plus nested files in newer versions |
| When rules apply | Always | Always, for matching files, when relevant, or when you mention them | Always |
| Shared with other tools | No | No | Yes |
| Recommended for | Nothing new. Migrate away from it | Cursor-only rules, especially ones that apply to certain files | Instructions every tool should follow |
If you have an old .cursorrules file, move its contents into AGENTS.md if other tools should follow them, or into .cursor/rules/ if they only make sense in Cursor.
Key takeaway: if you use one tool, use its preferred file. If you use several, make AGENTS.md the shared source and keep the rest small.
| Your situation | What to set up |
|---|---|
| You only use Claude Code | CLAUDE.md, or AGENTS.md if you might add other tools later |
| You only use Cursor | Project Rules in .cursor/rules/, or AGENTS.md for simple setups |
| Your team uses several tools | AGENTS.md for everything shared, plus small tool-specific files only where needed |
| You maintain an open source project | AGENTS.md, so contributors' tools pick it up whatever they use |
For teams using several tools, a practical setup:
Whatever the file, it's shared with everyone who can read your code, so never put secrets in it. Our guide What is .env? covers where those belong.
Key takeaway: include what an agent can't work out from your code and keeps getting wrong. Leave out anything it can already read elsewhere.
The same advice applies to all of these files. Here's a short example:
# AGENTS.md
## Commands
- Install dependencies: `pnpm install`
- Run tests: `pnpm test`
- Lint and format: `pnpm lint:fix` (run before every commit)
## Conventions
- Use pnpm, not npm or yarn
- Write tests with Vitest, not Jest
- Database changes need a migration in `migrations/`
## Don't
- Don't edit files in `generated/`. Run `pnpm codegen` instead.
- Don't commit `.env` files| Usually worth including | Usually worth leaving out |
|---|---|
| Exact commands to install, test, lint, and build | A general overview of the project |
| Which tool to use when several would work, such as pnpm or npm | The folder structure, which agents can see for themselves |
| Steps that must happen before a commit or pull request | Details already in package.json or pyproject.toml |
| Files or folders agents must not edit | General coding advice that applies to any project |
| Warnings about anything slow, costly, or risky to run | Secrets, passwords, or API keys |
Agents read your README too, so don't repeat it. Our Dev Center post AGENTS.md: Why your README matters more than AI configuration files makes the case in detail.
Key takeaway: context files full of instructions an agent doesn't need, especially ones an agent writes for itself, tend to make agents slower and more expensive.
It's tempting to have an agent generate a thorough instruction file describing your whole codebase. A February 2026 study from researchers at ETH Zurich and LogicStar.ai, Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?, tested that approach on several coding agents and real-world tasks. The results, as summarized in our Dev Center post:
| Type of context file | Effect on task success | Effect on cost |
|---|---|---|
| Generated by an agent | About 3% lower on average | Over 20% higher |
| Written by a developer | About 4% higher on average | Up to 19% higher |
Extra instructions led agents to explore more files and run more checks on every task. So:
Tests, linters, and type checkers often matter more than any instruction file, because they tell an agent immediately when something is wrong. For the full breakdown, read The research is in: your AGENTS.md is probably too long on the Upsun Developer Center.
Key takeaway: for an Upsun Cloud project, the most useful lines tell agents where the infrastructure is defined, how to check it, and what they must never touch.
Coding agents can read your code, but they can't see how your project is hosted unless something tells them. On Upsun Cloud, your apps, services, and routes are defined in one YAML file, .upsun/config.yaml. A few lines in AGENTS.md, or CLAUDE.md, can point agents to it:
## Deployment (Upsun Cloud)
- Infrastructure is defined in `.upsun/config.yaml`. Run `upsun app:config-validate` after changing it.
- Pushing to Git starts a build and deployment. Test changes in a preview environment before merging into production.
- Secrets are stored as Upsun Cloud variables. Never add them to the repository or to `.upsun/config.yaml`.
If you want agents to do more than edit code, Upsun offers two options. Upsun Skills is an open source skill that teaches coding agents to use the Upsun Cloud command line tool. Our upcoming guide What are agent skills? [ADD LINK WHEN LIVE] explains how skills work. The Upsun Cloud MCP server lets AI assistants query and manage projects, and it's read-only unless you turn on write access. If you use either, note in your instruction file which actions an agent should ask about first.
New to the configuration file itself? Our guide What is a YAML file? walks through it using a real Upsun Cloud example.
AGENTS.md is an open format many coding agents read. CLAUDE.md is Claude Code's own file. Claude Code reads AGENTS.md when a folder has no CLAUDE.md, and a CLAUDE.md can import AGENTS.md so shared instructions live in one place.
Yes. Cursor still supports it but lists it as legacy. Use Project Rules in .cursor/rules/ for Cursor-specific instructions, or AGENTS.md for instructions shared with other tools.
Yes. Cursor supports AGENTS.md as a plain Markdown alternative to its Project Rules.
Yes. Keep shared instructions in AGENTS.md and add @AGENTS.md to your CLAUDE.md, so Claude Code reads both without duplicate content.
Yes, so every developer and every agent gets the same instructions. Review changes to them like code changes, and never put secrets in them.
Use generated files with care. Research published in February 2026 found that agent-generated context files slightly lowered success rates and raised costs. A short file you write yourself, based on mistakes you've actually seen, tends to work better.
It can be. Agents treat its contents as instructions, so a malicious change could steer an agent into doing something harmful. Review changes carefully, and be wary of copying rules from unknown sources.