Egor Urvanov

Cursor rules vs AGENTS.mdWhat goes where

Cursor rules and AGENTS.md both give an agent standing instructions, and they differ in reach. AGENTS.md is plain markdown in the project root that Cursor and many other agents read. Rules in .cursor/rules are .mdc files with four application modes, and they are Cursor's own format. Put shared instructions in AGENTS.md and conditional ones in .mdc.

Quick answer

Cursor accepts two formats at once: AGENTS.md for simple cases and project rules for control over when a rule applies.

Takeaway
In this exampleAGENTS.md holds what every agent must know; .cursor/rules holds what only Cursor must know, and only sometimes.
In generalAGENTS.md has no modes and no metadata, so any agent can read it. An .mdc rule adds modes, so it can wait until a file type or a request calls for it.
Next stepMove commands and bans to AGENTS.md, keep file-type rules in .cursor/rules, delete .cursorrules.

Cursor rules and AGENTS.md side by side

Every cell comes from the Cursor, agents.md or OpenAI documentation; the source is behind the icon. Checked 15.11.2026.

AGENTS.md.cursor/rules/*.mdc
Scopethe project; a nested file for a subfolderthe project, split into rules; User Rules (all your projects) and Team Rules (a whole organization) are separate levels
Who reads itCursor, Codex, Copilot, Windsurf, OpenCode and othersCursor
File and placeAGENTS.md in the root and in subfolders; the nearest file to the edited one wins.cursor/rules/, one file per rule; rules can sit in folders
Formatplain markdown, no required fieldsmarkdown with a header of description, globs, alwaysApply; the extension must be .mdc, a plain .md is ignored
When it appliespicked up automatically, no modesone of four modes: always, by description, by file pattern, manually
Versioninga file in the repository, changes go through gitstored in the repository; the docs advise committing the rules
Sizethe Cursor docs give no figure; Codex caps all its instruction files together at 32 KiB by defaultunder 500 lines per rule, large ones split
Old .cursorrulesa single file in the root, replaced by both formats

Cursor also treats CLAUDE.md as always on: it applies to every conversation, whatever alwaysApply says.

Four modes of a Cursor rule

The mode decides when a rule enters the context. It is set in the rule's header and in the rule type menu.

Alwaysevery chat
By descriptionthe agent decides
By filesa path pattern matched
Manually@rule
Mode in CursorWhat triggers itHeader field
Always Applyevery chat sessionalwaysApply: true; globs and description are then ignored
Apply Intelligentlythe agent decides from the descriptiondescription with alwaysApply: false and no globs
Apply to Specific Filesa file matches a patternglobs
Apply Manuallyyou @mention the rule in chatthe rule is called by name, for example @my-rule

Older guides by third parties call the same four modes Always, Auto Attached, Agent Requested and Manual. The current Cursor docs use the names in the table.

Migration: from .cursorrules to AGENTS.md and .mdc

An example project, written for this article. The file formats follow the Cursor docs; the project is made up.

Before: one file in the root

Project tree before

my-app/
├── .cursorrules
├── src/
└── package.json

.cursorrules

You are working on a React + TypeScript app.
Run `npm test` before finishing a task.
Format with `npm run lint -- --fix`.
Never edit files in dist/.
Never log tokens or user emails.
Components: function components with hooks, one component per file,
props typed with an interface named <Name>Props.
The test file sits next to the component: Button.test.tsx.
API calls go through src/api/client.ts; validate every response with zod.
The official way: four steps
1Createa rule via the command palette: “New Cursor Rule”
→
2Copythe text from .cursorrules
→
3ModeAlways Apply
→
4Delete.cursorrules from the root

These are the four steps of the Cursor guide; Always Apply keeps the old behavior. The result is one rule that is always on. A split by condition is the next step.

After: shared text in AGENTS.md, conditional text in .mdc

Project tree after

my-app/
├── AGENTS.md
├── .cursor/
│   └── rules/
│       ├── react-components.mdc
│       └── api-validation.mdc
├── src/
└── package.json

AGENTS.md

# my-app
React + TypeScript app.

## Commands
- Run `npm test` before finishing a task.
- Format with `npm run lint -- --fix`.

## Bans
- Never edit files in `dist/`.
- Never log tokens or user emails.

.cursor/rules/react-components.mdc

---
description: Standards for React components
globs: "*.tsx"
alwaysApply: false
---
- Function components with hooks, one component per file.
- Props typed with an interface named `<Name>Props`.
- The test file sits next to the component: `Button.test.tsx`.

.cursor/rules/api-validation.mdc

---
description: Rules for API calls and response validation
alwaysApply: false
---
- API calls go through `src/api/client.ts`.
- Validate every response with zod.
Takeaway
In this exampleNine lines of one file became three files: five lines every agent reads, and two rules that Cursor loads only when they apply.
In generalCommands and bans hold for the whole project, so any agent needs them. Component and API rules matter only for part of the code: the first for .tsx files, the second when the agent judges the description relevant.
Next stepSplit the old file by one question: does every agent need this line in every session? Yes goes to AGENTS.md, no goes to a rule with a mode.

Which agents read AGENTS.md

The agents.md site lists many supporting agents, among them Codex, Cursor, Copilot, Windsurf, Gemini CLI, Zed and Warp. The conditions differ by agent: Claude Code reads AGENTS.md only when the project has no CLAUDE.md, Gemini CLI after a setting is changed.

What goes where

WhatWhereWhy
Build and test commandsAGENTS.mdevery agent needs them in every session
Bans: no editing of dist/, no secrets in logsAGENTS.mdhold for the whole project
Style of one file type, for example *.tsx.mdc, Apply to Specific Filesloads only when such a file is in play
A topic needed from time to time: API calls, migrations.mdc, Apply Intelligentlythe agent reads the description and pulls the rule in
A rare checklist.mdc, Apply Manuallyenters the chat only on @mention
A rule for the whole organizationTeam Rulesmanaged from the Cursor dashboard on Team and Enterprise plans

Keep each instruction in one place. A line copied into AGENTS.md and into a rule has to be fixed twice.

Frequently asked questions

Does Cursor read AGENTS.md?

Yes. Cursor reads AGENTS.md in the project root and in subfolders, as plain markdown without metadata, and picks it up automatically. Instructions from a nested AGENTS.md are combined with those of parent folders, and the more specific ones take precedence. Source: cursor.com/docs/context/rules and cursor.com/help/customization/rules, checked 15.11.2026.

Do I still need .cursorrules?

No. The Cursor docs call the root .cursorrules legacy and describe the move: create a rule in Always Apply mode, copy the text, delete the file. Source: cursor.com/help/customization/rules, checked 15.11.2026.

Can I keep both AGENTS.md and .cursor/rules?

Yes. Cursor describes them as two options: AGENTS.md for simple cases, project rules for control over when a rule applies. A sensible split is shared commands and bans in AGENTS.md and rules with a condition in .cursor/rules; each instruction lives in one place. Source: cursor.com/help/customization/rules, checked 15.11.2026.

How many rules and how long should they be?

Cursor recommends under 500 lines per rule and splitting large rules into smaller, focused files. The pages checked name no cap on the number of rules and no length for AGENTS.md; Codex caps its AGENTS.md files together at 32 KiB by default. Sources: Cursor and OpenAI docs, checked 15.11.2026.
Based on the Cursor, agents.md and OpenAI documentation, the source is behind the icon next to each claim; checked 15.11.2026. The example project is made up.
© 2026 Egor Urvanov