Quick answer
Cursor accepts two formats at once: AGENTS.md for simple cases and project rules for control over when a rule applies.
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 | |
|---|---|---|
| Scope | the project; a nested file for a subfolder | the project, split into rules; User Rules (all your projects) and Team Rules (a whole organization) are separate levels |
| Who reads it | Cursor, Codex, Copilot, Windsurf, OpenCode and others | Cursor |
| File and place | AGENTS.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 |
| Format | plain markdown, no required fields | markdown with a header of description, globs, alwaysApply; the extension must be .mdc, a plain .md is ignored |
| When it applies | picked up automatically, no modes | one of four modes: always, by description, by file pattern, manually |
| Versioning | a file in the repository, changes go through git | stored in the repository; the docs advise committing the rules |
| Size | the Cursor docs give no figure; Codex caps all its instruction files together at 32 KiB by default | under 500 lines per rule, large ones split |
| Old .cursorrules | a 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.
| Mode in Cursor | What triggers it | Header field |
|---|---|---|
| Always Apply | every chat session | alwaysApply: true; globs and description are then ignored |
| Apply Intelligently | the agent decides from the description | description with alwaysApply: false and no globs |
| Apply to Specific Files | a file matches a pattern | globs |
| Apply Manually | you @mention the rule in chat | the 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.
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.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.
Project tree after
my-app/
├── AGENTS.md
├── .cursor/
│ └── rules/
│ ├── react-components.mdc
│ └── api-validation.mdc
├── src/
└── package.jsonAGENTS.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..tsx files, the second when the agent judges the description relevant.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
| What | Where | Why |
|---|---|---|
| Build and test commands | AGENTS.md | every agent needs them in every session |
Bans: no editing of dist/, no secrets in logs | AGENTS.md | hold for the whole project |
Style of one file type, for example *.tsx | .mdc, Apply to Specific Files | loads only when such a file is in play |
| A topic needed from time to time: API calls, migrations | .mdc, Apply Intelligently | the agent reads the description and pulls the rule in |
| A rare checklist | .mdc, Apply Manually | enters the chat only on @mention |
| A rule for the whole organization | Team Rules | managed 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.