Launch offer: use code LAUNCH20 for 20% off any single pack. See all kits

AGENTS.md vs CLAUDE.md vs Cursor Rules: Which Do You Need?

Published 2026-10-16 · 4 min read · by AgentKit Co

If you use an AI coding agent, you have probably been told to "write a rules file". Then you looked and found four or five different file names. This guide explains what each one is, which tools read it, and the smallest setup that works for most people. Everything here was checked against each tool's own documentation on 2026-10-16, but these tools change fast, so use the links at the end to confirm.

The one idea behind all of them

A coding agent starts every session knowing nothing about your project. An instruction file is the short note you would give a new teammate: how to run things, how the code is organized, what to avoid. The files differ only in which tool reads them and how precisely you can scope them.

The files

File What it is Who reads it
AGENTS.md Plain Markdown, no required fields. Can also live in subfolders; the closest file to the one being edited wins. Cursor, GitHub Copilot, OpenAI Codex, Zed, Warp, Windsurf and many others. Gemini CLI and Aider need a one-line setting.
CLAUDE.md Markdown instructions for Claude Code. Project, personal (~/.claude/CLAUDE.md) and private (CLAUDE.local.md) versions. Claude Code
.claude/rules/*.md Topic files. With a paths: list in the frontmatter they load only when matching files are in play. Claude Code
.cursor/rules/*.mdc Cursor project rules with description, globs and alwaysApply frontmatter. A plain .md file there is ignored. Cursor
.github/copilot-instructions.md Repository-wide Copilot instructions. Path-specific files go in .github/instructions/ and use an applyTo glob. GitHub Copilot

The old single-file .cursorrules is not described on Cursor's current rules page, so new projects should skip it (see Cursor rules not working? and how to migrate .cursorrules to .mdc).

A setup that works for most people

  1. Write one AGENTS.md at the repository root. Put commands, layout, conventions and boundaries in it.
  2. If you use Claude Code, add a CLAUDE.md whose first line is @AGENTS.md. That is Claude Code's import syntax, and it means you maintain the shared rules in one place. Anthropic's docs currently say Claude Code reads AGENTS.md by itself only when there is no CLAUDE.md in the working directory or above, which is why the bridge file is the safe choice.
  3. Move area-specific rules into scoped files instead of growing the root file: a Cursor .mdc rule with globs, a Claude .claude/rules/ file with paths, or a Copilot .instructions.md file with applyTo. (Moving Cursor rules to Claude? .claude/rules examples has a free script that converts .mdc files.)
@AGENTS.md

## Claude Code
- Use plan mode before changing anything under `src/billing/`.

Keep AGENTS.md as one source of truth

Once you have more than one tool reading project rules, duplication gets expensive. A practical pattern:

  1. Put the real rules in root AGENTS.md (commands, layout, boundaries, PR discipline).
  2. Generate or hand-write thin wrappers for tools that want their own filename: a CLAUDE.md whose first line is @AGENTS.md, a short Copilot copilot-instructions.md that points reviewers at the same norms, or scoped Cursor .mdc files for path-specific extras only.
  3. When a rule changes, edit AGENTS.md once. Re-copy or re-generate wrappers if they hold more than a pointer.

If you want help keeping those wrappers in sync in CI, one free MIT option is agentscribe on PyPI (syncs AGENTS.md toward Claude/Cursor/Copilot/Gemini/Windsurf/Cline-oriented files and can lint in CI). We are not affiliated with it; treat it as an example of the pattern, not a requirement. Our free AGENTS.md generator still helps you draft the root file in the browser.

How long should the file be?

Shorter is better. Anthropic suggests keeping each CLAUDE.md under 200 lines, and Cursor suggests rules under 500 lines. A good target for the root file is 60 to 120 lines. Longer files use up context and make it more likely that a rule gets ignored.

Instruction files are guidance, not enforcement

An agent can still ignore a line. Claude Code's docs say plainly that it treats these files as context rather than enforced configuration. If something must never happen, such as touching production data, back the instruction with a permission setting, a hook or a git check.

Next steps

  • Build a first file in a minute with the free AGENTS.md generator. It runs in your browser and sends nothing anywhere.
  • Read how to write an AGENTS.md that agents follow for what to put in each section.
  • For ready-made files for twelve stacks, scoped rules for Claude, Cursor and Copilot, and prompts that audit your setup, see the AI Coding Agent Config Kit below.

Want ready-made files? See our copy-paste AGENTS.md examples, CLAUDE.md examples and Cursor rules examples.

Sources: agents.md, Claude Code memory docs, Cursor rules docs, GitHub Copilot repository instructions. AgentKit Co is not affiliated with these companies. This guide was written with AI assistance and checked against those pages.

AI Coding Agent Config Kit · $14

Instruction-file templates for 12 stacks and 12 prompts that write and audit them.

34-page PDF, $14.

Not ready to buy? Get our free Agent Skills pack on Gumroad (pay what you want, $0 is fine; Gumroad asks for your email to deliver it). Get the free skills

Keep reading

Agent Skills (SKILL.md) Explained: Formats, Folders and SafetyWhat an Agent Skill is, how SKILL.md works, which folders Claude Code, Codex, Cursor and Copilot read, and how to write and vet one. Checked on 2026-10-17.5 min readAGENTS.md Examples: 7 Copy-Paste Files for Real Projects (2026)Seven AGENTS.md examples to copy: Next.js, Python API, Go, a monorepo with nested files, a global ~/.codex file, an override and review rules.8 min readWhat Is an AI Agent? Plain-English Guide for BeginnersWhat an AI agent is, how it differs from a chatbot or automation, and the four building blocks every agent has. No jargon.4 min read