Free guide · Claude × Cursor
CLAUDE.md vs .cursor/rules: which one wins
The honest answer is that this is the wrong question, and the right one is more useful: which tool is reading which file right now? The relationship is asymmetric, it is documented, and once you see it the “my rules are being ignored” reports stop.
The short version
- Cursor reads both. It reads
.cursor/rulesand it readsCLAUDE.md— and per Cursor’s docs,CLAUDE.mdis applied to every conversation regardless of anyalwaysApplysetting — who reads what. - Claude Code does not read
.cursor/rules. It has its own files —CLAUDE.mdand a.claude/rules/directory. The only documented crossover is/init, a one-time import — the Claude Code side. - Within Cursor there is a documented order: Team Rules → Project Rules → User Rules, all merged, earlier sources winning conflicts — precedence.
- A
.mdfile in.cursor/rulesis silently ignored. Project rules must use.mdc— gotchas.
New to all this? Skip the box — the explanation starts below.
What these two files actually are
Both files do the same broad job: they are standing instructions you write once so you do not have to repeat yourself in every chat. “Use tabs, not spaces.” “Never touch the generated folder.” “Validate input before it reaches the database.” The difference is which program picks them up.
.cursor/rulesis Cursor’s own rules system — a folder in your repository holding one or more rule files, each of which can be scoped so it only applies to certain files.CLAUDE.mdis Claude Code’s instruction file — a plain markdown file that Claude Code loads as memory.
People assume these two fight each other because both are “the rules file,” and both are sitting in the same repository. They are not symmetrical, though, and that asymmetry is the whole answer.
Who reads what
| File | Cursor’s agent | Claude Code |
|---|---|---|
.cursor/rules/*.mdc | Yes — its native rules system | No, not at runtime. Only pulled in once by /init |
CLAUDE.md | Yes — and always applied to every conversation, regardless of alwaysApply | Yes — this is its primary memory file |
AGENTS.md | Yes — an alternative to .cursor/rules for simpler cases | No. The docs are explicit: Claude Code reads CLAUDE.md, not AGENTS.md |
.claude/rules/ | No | Yes — its own topic-scoped rules, optionally limited by paths: frontmatter |
Read that middle row again, because it is the single most consequential fact on this page: if you keep a CLAUDE.md in a repo you open in Cursor, it is in effect for every Cursor conversation too — not just your Claude Code sessions. Most people who write a CLAUDE.md do not realise Cursor is also obeying it.
Precedence, where it genuinely exists
Inside Cursor’s rules system, the order is documented: Team Rules → Project Rules → User Rules. All applicable rules are merged, and earlier sources take precedence when guidance conflicts. So a team rule beats your personal preference, which is the sane way round.
Two related details that surprise people. First, Cursor identifies rules by their full file path, not by filename — two rules with the same name in different folders both apply if their conditions match, and neither overrides the other. Second, AGENTS.md files nest: instructions from a nested AGENTS.md are combined with those from parent directories, with the more specific ones taking precedence.
On the Claude Code side, the model is concatenation, not overriding. Files load from broadest to most specific — managed policy, then user, then project, then local — so a project instruction simply appears later in context than a user instruction. Nothing is deleted by anything else.
What is not documented anywhere: a precedence ranking between CLAUDE.md and .cursor/rules as such. They are not ranked against each other because they are not competing entries in one list — they are two inputs that both end up in context. If two of your instructions contradict, no rule decides the winner for you. That is a bug in your setup, not a feature to look up.
The Claude Code side in detail
Claude Code loads memory files in this order, broadest scope first:
| Scope | Path |
|---|---|
| Managed policy | /Library/Application Support/ClaudeCode/CLAUDE.md (macOS), /etc/claude-code/CLAUDE.md (Linux/WSL), C:\Program Files\ClaudeCode\CLAUDE.md (Windows) |
| User | ~/.claude/CLAUDE.md |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md |
| Local, gitignored | ./CLAUDE.local.md |
Within a directory tree, files load from the filesystem root down toward your working directory, and CLAUDE.local.md loads after CLAUDE.md in the same folder. Memory files in subdirectories are loaded on demand rather than at launch.
You can also split a large file up: @path/to/import pulls in another file from anywhere in your CLAUDE.md. Relative paths resolve against the importing file, not your working directory, and imports recurse up to four hops deep. A path wrapped in backticks is treated as literal text, not an import — handy when you want to mention a file rather than load it.
The one sanctioned bridge between the two ecosystems is /init. When it generates a CLAUDE.md, it reads your existing Cursor rules — .cursor/rules/ or .cursorrules — and folds the relevant parts in. That is a one-time incorporation at generation time. It does not set up any ongoing sync, and it does not mean Claude Code consults .cursor/rules afterwards.
The gotchas that actually bite
- A
.mdfile in.cursor/rulesdoes nothing. Project rules must use the.mdcextension. A plain.mdfile there is ignored by the rules system because it has no frontmatter — and it fails silently, which is the worst way to fail. - Cursor’s User Rules do not apply to Inline Edit. They are used by Agent (Chat). If a rule “works in chat but not when I hit Cmd+K,” that is expected behaviour, not a broken rule.
alwaysApplydoes not restrainCLAUDE.md. The frontmatter switches govern.mdcrules. Cursor appliesCLAUDE.mdto every conversation regardless.- Duplication is the real enemy. Two files stating the same policy in different words is how you end up with an agent that follows the older, wronger version. Delete, do not restate.
A setup that does not contradict itself
Decide which file owns each topic, then hold the line:
- Codebase conventions that are true no matter who is driving — architecture, naming, what not to touch — belong in
.cursor/rules, scoped withglobsso they attach only where relevant. - Instructions you want in effect everywhere, in both tools — belong in
CLAUDE.md, since both Cursor and Claude Code read it. This is the honest reason to keep aCLAUDE.mdeven in a Cursor-first team. - Personal preferences — verbosity, commit style — belong in Cursor’s User Rules under
Customize → Rules, or in~/.claude/CLAUDE.md. Not in the repo, where they become everyone’s problem.
Here is a scoped Cursor rule doing its job — narrow, specific, and attached only to the files it concerns:
---
description: API route conventions
globs: src/api/**/*.ts
alwaysApply: false
---
- Every route handler validates its input before touching the database
- Errors return a problem+json body, never a bare stringAnd an always-on one, straight from Cursor’s documentation:
---
alwaysApply: true
---
- All source files must include the company copyright header
- When you are unsure about implementation details, read the relevant
source files before proposing changes
- Never modify generated files in the `dist/` or `build/` directoriesHow to check what is actually loaded
Do not audit this by reading your own files — read them and you will see what you intended, which is exactly the thing in question. Open a fresh session and ask the agent to tell you which rules are currently active and where each came from. If it names something you do not recognise, or cannot account for a rule you know exists, that is your real configuration. Fix the files, then ask again.
What to read next
If you still have a legacy .cursorrules file in the mix, clear that up first — .cursorrules is deprecated. For how the two tools divide responsibility more broadly, read Using Claude with Cursor.