If your Cursor rules are not applying, the cause is almost always the rule’s trigger scope (where it is supposed to activate) or a feature conflict (like a disabled toggle or an overlapping rule). This guide explains both, shows you how to fix them, and helps you write rules that reliably take effect.
What Are Cursor Rules and How Do They Work?
Cursor is an AI code editor that lets you create custom instructions, called rules, to shape how the AI writes or edits code in your project. Rules are plain-text files (usually .mdc or .cursorrules) that tell the AI things like “always use TypeScript” or “never use any”, and they are applied automatically when the AI works on files that match the rule’s trigger scope.
Rules work through a two-part system:
- Content – the actual instructions you write (e.g., “use 2-space indentation”).
- Trigger scope – the glob pattern that decides which files the rule applies to (e.g.,
src/**/*.ts).
If either part is misconfigured, the rule won’t fire. The most common mistake is writing a rule with a scope like *.ts when your files are in a subfolder, or forgetting to enable the rule in the settings.
Step-by-Step: How to Check Your Rule’s Trigger Scope
- Open Cursor and go to Settings (gear icon) > Rules.
- Find the rule that isn’t applying and click the edit (pencil) icon.
- Look at the Glob field – this is the trigger scope. It must match the paths of the files you want the rule to affect.
- Test the pattern: if your files are in
src/utils/helper.ts, a glob ofsrc/**/*.tsworks, but*.tsdoes not (because it only matches files in the root). - If the glob looks correct, check the Enabled toggle – it must be on.
- Also verify that the rule isn’t being overridden by a more specific rule (Cursor gives priority to the most specific glob match).
After editing, restart Cursor or reload the window (Ctrl+Shift+P > “Reload Window”) to ensure the rule is re-read.
Common Reasons Why Rules Don’t Apply (and Fixes)
Here are the most frequent culprits, with concrete fixes:
- Wrong glob pattern – Use
**/*.tsfor all TypeScript files, orsrc/**/*.tsxfor TSX files in the src folder. Avoid patterns like*.tsunless your files are in the root. - Rule not enabled – In the rules list, each rule has an enable/disable toggle. Make sure it’s blue (enabled).
- Overlapping rules – If two rules match the same file, Cursor may apply only the one with the more specific glob. Check for conflicting rules and merge them.
- Rule file location – Global rules (in
~/.cursor/rules) apply everywhere, but project rules (in.cursor/rulesin your project root) only apply when that folder is open. If you’re in the wrong project, the rule won’t fire. - Stale cache – Sometimes Cursor caches rules. Restart the editor to refresh.
- Syntax error in the rule – A missing colon or bracket can break the entire rule. Check for typos in the glob or the content.
How to Choose the Right Trigger Scope for Your Rules
Choosing the correct glob pattern is the key to making rules work. Here’s a practical guide:
- All files in a folder:
src/**/*matches every file undersrc/. - All files of a type:
**/*.pymatches every Python file in the project. - Specific file:
src/config.tsmatches only that file. - Multiple extensions:
**/*.{js,jsx}matches both .js and .jsx files. - Exclude a folder: You can’t directly exclude, but you can make a rule more specific (e.g.,
src/**/*.tswon’t matchtests/**).
Test your glob with a tool like globster.xyz (a free online glob tester) to see which files match. This saves time and prevents mistakes.
Feature Conflicts: When Rules Compete or Get Ignored
Even with a correct scope, rules can be ignored due to feature interactions:
- AI model differences – Some models (like older ones) may not fully support rules. Check that your model is up-to-date.
- Chat vs. Agent – Rules apply to the Agent mode, but in Chat mode they might only apply if you explicitly reference them. Use the Agent for automatic rule application.
- Inline rules vs. project rules – If you have a rule in your
.cursorrulesfile and also a project rule, the project rule may override the inline one. Keep only one source. - Disabled features – In Cursor settings, there’s an option to “Enable Rules” – if this is off, no rules apply. Go to Settings > General > Rules and make sure it’s toggled on.
How to Test If a Rule Is Actually Working
To verify a rule is active, do a quick test:
- Create a simple rule: “Always add a comment saying ‘RULE APPLIED’ at the top of files.”
- Set the scope to
**/*.txt. - Create a new .txt file and ask the AI to write something in it.
- If the comment appears, the rule works. If not, check the scope and enable status again.
This test isolates the rule from other variables and gives you a clear yes/no answer.
Frequently Asked Questions
Why does my rule work in one file but not another?
That’s almost always a glob pattern issue. The rule’s scope is too narrow – it matches one file but not the other. Check the file paths and update the glob to cover both (e.g., use **/*.ts instead of src/one.ts).
Can I use multiple rules at once?
Yes, you can have many rules, but they must not conflict. If two rules have the same scope and contradictory instructions, Cursor will apply the one with the more specific glob. To avoid confusion, keep rules focused and non-overlapping.
Do rules apply to the AI in the chat panel?
Rules apply to the AI in the editor (Agent mode) automatically. In Chat mode, you can reference a rule by typing @rule to include it manually. For full automation, use the Agent.
What’s the difference between .cursorrules and .mdc files?
.cursorrules is a single file in your project root that applies to the whole project. .mdc files are individual rule files stored in .cursor/rules folder, each with its own glob scope. The latter gives you more granular control.
How do I update a rule after changing it?
After editing a rule, save the file and reload the Cursor window (Ctrl+Shift+P > “Reload Window”). This forces Cursor to re-read all rules. If it still doesn’t work, restart the editor completely.
Alternatives and Best Practices for Reliable Rules
If rules are still not applying, consider these alternatives:
- Use a global rule – Put your most important instructions in
~/.cursor/rulesso they apply to every project. - Write rules in plain English – Avoid ambiguous phrasing. Instead of “use good style”, say “use 2-space indentation and single quotes”.
- Keep rules short – Long rules are more likely to be partially ignored. Break them into multiple focused rules.
- Check for updates – Cursor updates frequently; a bug in an older version might be fixed. Update to the latest version.
By systematically checking the scope, enabling status, and feature conflicts, you can get your rules working reliably. Remember: the trigger scope is the most common failure point, so always start there.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Arctic Sea Ice Forecasts Disagree: What to Do
- MySQL Workbench to VPS: SSH Tunnel Setup
- Bluesky Beginners Guide: How to Get Started5.00 min/km
- LG V20 Won’t Turn On? Fixed
- Snagit vs Camtasia: Which One Do You Need?
- Scale a Small Business Without Losing Culture