Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Apply to Specific Files Rules are not reliably included for matching files in a multi-root workspace.
I tested repository-local Project Rules using:
description: Adds a marker when editing Java files
globs: src/**/*.java
alwaysApply: false
The Rule is stored under repoB/.cursor/rules/ and the target file is under repoB/src/**/*.java.
The behavior is inconsistent. In some tests the Rule instruction was followed, while in others a matching repository-local Rule was not followed.
This matters in multi-root workspaces because alwaysApply: true is not a safe workaround for repository-specific Rules. An Always Rule from one workspace root can be included while Agent is working in another root.
So alwaysApply: false with globs is the intended automatic scoping mechanism, but it does not currently appear reliable enough to guarantee that a matching repository-specific Rule is included.
Steps to Reproduce
-
Create a multi-root .code-workspace with two workspace roots:
Workspace
-repoA/ ← workspace root
-repoB/ ← workspace root
– .cursor/
—rules/
----java-rule.mdc
–src/
—main/
----java/
-----Test.java -
Add this Rule under repoB/.cursor/rules/java-rule.mdc:
description: Adds a marker when editing Java files
globs: src/**/*.java
alwaysApply: false
When editing a Java file, add this comment as the first line if it is not already present:
// MARKER_770
-
Open both repoA and repoB as separate roots in the same multi-root workspace.
-
Start a new Agent chat.
-
Ask:
Add a Hello World example to repoB/src/main/java/Test.java. -
Do not explicitly mention or open the Rule.
-
Repeat the test in a new chat.
I also reproduced inconsistent behavior when both repositories had their own correctly scoped Rules using:
globs: src/**/*.java
alwaysApply: false
In that setup, one repository’s marker was missing while the other repository’s marker was added.
Expected Behavior
Because repoB/src/main/java/Test.java matches src/**/*.java relative to the repoB workspace root, the repository-local Rule should be included when Agent works with that file.
If the model follows the Rule instruction, MARKER_770 should be added.
For two repositories with separate correctly scoped Rules, each repository’s Rule should be triggered independently by matching files in that repository.
Operating System
MacOS
Version Information
Version: 3.15.6
VS Code Extension API: 1.128.0
Commit: a1f686545fd0ce8917bbd2449f733551a9bce420
Date: 2026-08-06T01:41:03.876Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 24.1.0
Workspace type: multi-root .code-workspace
For AI issues: which model did you use?
Auto
Additional Information
As an additional diagnostic, I asked Agent afterward which Rules had already been present in its context. In several tests, Agent reported that the repository-local Rule had not been part of its initial workspace-rule context and that it read the Rule during the task.
I understand that Agent self-report is not a reliable prompt trace, so I am not treating this as definitive evidence of when the Rule entered context. The main issue is the inconsistent generated behavior for matching repository-local Rules.
This appears related to existing reports about Apply to Specific Files / glob-scoped Rules not always being included reliably.
I can provide a minimal reproduction workspace if useful.
Does this stop you from using Cursor
No - Cursor works, but with this issue