Menu

Post image 1
Post image 2
1 / 2
0

Why Cursor Agent Ignores Your .cursorrules (And Rewrites the Wrong Files)

DEV Community: productivity·Olivia Craft·1 day ago
#On87v7yI
#dev#cursor#rules#auth#scoped#photo
Reading 0:00
15s threshold

You gave Cursor a clear instruction: do not modify files in src/auth/ . Cursor opened src/auth/session.ts and rewrote the token refresh logic. No error. No warning. It simply decided that instruction did not apply to this particular edit. This is the most common source of broken Cursor Agent runs — and it is not a bug. It is by design. Why .cursorrules Has No Scope .cursorrules is a single global file. Every instruction in it applies to the entire project. When you write a rule like "do not touch the auth module", Cursor reads that as a preference, not a boundary. The model interprets it contextually. If the current task seems related to auth, the model may proceed anyway because it is trying to be helpful. There is no file-level or folder-level enforcement. The rule does not know what src/auth/ is. What Actually Works: Scoped .mdc Rules The proper system for scoped rules is .cursor/rules/*.mdc . Each file can be scoped with globs frontmatter.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More