Free toolGenerate .mcp.json configs for Claude Code, Cursor & Codex →
▲

Anysphere · Cursor editor · Cursor CLI

Cursor rules files explained

Which instruction files Cursor reads (.cursor/rules/*.mdc, AGENTS.md, .cursorrules (legacy)), where to put them, and how to convert from other agents.

Files Cursor reads

  • .cursor/rules/*.mdc
  • AGENTS.md
  • .cursorrules (legacy)

AGENTS.md: Yes, in the project root and in subdirectories (nested files combine).

Skills folders: .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/

Who reads what

AgentRules filesAGENTS.md
ClaudeCLAUDE.md, .claude/rules/*.mdOnly when no CLAUDE.md / CLAUDE.local.md exists (default, v2.1.277+); or import it with @AGENTS.md
CodexAGENTS.md, AGENTS.override.mdYes: global ~/.codex/AGENTS.md plus one AGENTS.md (or AGENTS.override.md) per directory from the repo root down
Cursor.cursor/rules/*.mdc, AGENTS.md, .cursorrules (legacy)Yes, in the project root and in subdirectories (nested files combine)
Copilot.github/copilot-instructions.md, .github/instructions/*.instructions.md, AGENTS.mdYes on most surfaces (cloud agent, CLI, VS Code chat, code review); not Copilot Chat on GitHub.com
AntigravityAGENTS.md, GEMINI.md, .agents/rules/*.mdYes: AGENTS.md or GEMINI.md at any directory level, always on
Convert your rules file →

Cursor rule types and the .mdc format

Cursor has four kinds of instructions: Project Rules in .cursor/rules, User Rules that apply across your Cursor environment, Team Rules managed from the dashboard on Team and Enterprise plans, and AGENTS.md as a plain-markdown alternative to .cursor/rules.

Project rules must use the .mdc extension. Cursor's docs say a plain .md file in .cursor/rules is ignored by the rules system because it has no frontmatter. The frontmatter keys are description, globs and alwaysApply, and the type dropdown sets them: Always Apply, Apply Intelligently (Agent decides from the description), Apply to Specific Files (globs match), and Apply Manually (only when you @-mention the rule).

Use comma-separated globs such as src/components/**/*.tsx to scope a rule to part of the codebase. To write one without hand-editing frontmatter, type /create-rule in Agent and describe what you want; Agent saves the file to .cursor/rules. Files can be named anything and organized in subfolders, such as .cursor/rules/frontend/components.mdc, and because they live in the repository they are version-controlled with your code.

Source: cursor.com · Checked Oct 24, 2026

Featured spot on the rules libraryReach developers choosing tools for their coding agent. Labeled, and it never affects ratings.

Guides, pricing & comparisons