I’m trying to understand how .cursor/rules/ actually works with subdirectories. I have a monorepo setup where I have a subdirectory at /root/frontend/. I created a rule in /root/frontend/.cursor/rules/some-rule.mdc with alwaysApply: true, expecting it to kick in whenever the agent works with files in that subdirectory. But when I asked the agent to explain a route that exists in frontend code, it read multiple files from that folder but never picked up my rule. Only the rules from my root .cursor/rules/ folder showed up. So my question is: when does Cursor actually pick up rules from subdirectory .cursor/rules/ folders? Is alwaysApply only respected at the workspace root level? Do I need to use globs instead? Would love some clarity on the exact mechanics here.
I’ve also played more with root-level rules like ‘Apply Intelligently’ and ‘Apply to Specific files,’ but they’re very unreliable. I’ve tried different glob patterns (and the UI highlights incorrect ones, so I know mine are right) and many descriptions for “Apply Intelligently” and tested them with different prompts across different models, but the rules mostly don’t trigger. They only seem to work sometimes with Opus 4.5, and even then it’s hit-or-miss. What’s the expectation for these?
Base on my undertstanding, Cursor try to migrate Rule into Skill. So, rather than using Cursor Rule, try to use Agents (http://agent.md/) since its open format and Cursor implement it really well.
there are command in Cursor for migrate rule into skill,
hi @Luv_Agarwal.cursor/rules should be at your workspace root only - not in subdirectories. Rules can be organized into folders within.cursor/rules (like .cursor/rules/frontend/some-rule.mdc), but Cursor doesn’t discover separate .cursor/rules directories in subdirectories.
For your monorepo setup, you have two options:
Option 1: Use workspace root rules with globs
Move your rule to /project/.cursor/rules/frontend/some-rule.mdc and add globs to scope it.
Option 2: Use AGENTS.md in subdirectories
Create /project/frontend/AGENTS.md instead. Unlike .cursor/rules, AGENTS.md files are automatically discovered and applied when working with files in that directory or its children. This is the recommended approach for monorepo subdirectory-specific instructions.
The alwaysApply property works for rules in the workspace .cursor/rules, but your nested /project/frontend/.cursor/rules/ location isn’t being scanned by Cursor.