There’s a lot of different ways people are specifying the globs in rules, I’m wondering what is the official schema for them?
YAML Array
globs: ['src/**/*.ts', 'tests/**/*.ts']
or
globs:
- 'src/**/*.ts'
- 'tests/**/*.ts'
Single String w/ quotes
globs: 'src/**/*.ts, tests/**/*.ts'
Single string (no quotes)
globs: src/**/*.ts, tests/**/*.ts
I’m seeing lots of files with the last but I’m guessing the first format is the correct one?
Specifying this better would make a great addition to the docs.
5 Likes
Yeah, that’s what I’m gathering but would be great for the Cursor team to put at least one example with the correct syntax in the docs .
9 Likes
bmarker
(Bradley Marker)
August 1, 2025, 1:52am
5
It would also be nice if the supported glob patterns were clarified. For example, does *.?(m|c)ts?(x) work?
Support for ignore patterns would be very nice to have
KyleM
(Kyle)
September 4, 2025, 12:12am
8
please document the glob syntax. no spaces after commas for example is huge as the IDE has no visual indication of a space when editing a rule.
Space after comma:
No space after comma:
Also syntax support for groups, optional, negate, etc would be really nice . For example, /**/*.{j,t}s?(x) or /tests/**/*.{spec,test}.{js,ts}
7 Likes
Cursor team, please include examples in the docs for glob patterns.
1 Like
@deanrie any chance for this to get some highlight?
deanrie
(Dean Rie)
October 12, 2025, 5:32pm
11
Hey, thanks, I’ll pass this to the team.
I can’t find documentation anywhere online for the globs format. This is super frustrating. Can we please get some documentation?
Same here — I can’t believe there’s no clear documentation on the exact syntax and format for glob rules in Cursor.
1 Like
+1 – not only are there not clear examples of how rule globbing is supposed to work (and this behavior seems to keep changing in the IDE), we’ve even been getting gaslighted by the cursor docs changing the specs for even how to define rule files
Cursor rules docs over the last few weeks:
2025-11-22 - docs show .cursor/rules/*.mdc structure
2025-12-27 - docs start reporting .cursor/rules/<rule-name>/RULE.md structure (this appears to happen until 2026-01-10 according to wayback machine)
2026-01-15 (today) - docs are back to .cursor/rules/*.mdc structure
Cursor team, please give some TLC to your cursor rules page and try to prevent your own IDE/AI from hallucinating how rules are supposed to work
3 Likes
Cursor rules are quite unreliable IMO and will wait for the response from cursor team: I am not clear on how exactly cursor rules are applied - #3 by Luv_Agarwal
David_Mann
(David Mann)
February 7, 2026, 8:45am
16
@Cursor Team please add the documentation here: Rules | Cursor Docs
This does not even have one example
For now, the accepted answer seems to be here: Allow escaping comma in cursor rules glob patterns - #2 by jameslamine
Colin
(Colin)
February 9, 2026, 8:57am
18
Good callout @David_Mann ! I had a PR to the docs open for this a few weeks ago but it got lost. I’ll revive it.