Do Glob Pattern Rules only apply via explicit tagging?

When creating rules that “Apply to Specific Files” via glob patterns, at what point in the Agent’s workflow are those glob patterns triggered to apply the rule?

I’ve noticed that hovering over the Context Usage symbol at the end of a session, I only am seeing my Always Applied rules. In those sessions, I do not explicitly @ a file/folder that matches a glob pattern, but the Agent does end up modifying files that would. This is the same whether using Plan or Agent mode.

Does Cursor apply those rules when those files are modified, or do I have to know in advanced to @ them in the prompt for them to be applied?

Hey, thanks for the request.

As designed, “Apply to Specific Files” rules should trigger automatically when the agent reads or edits files that match the glob pattern, so you don’t need to mention them explicitly with @. This is described in the rules docs as “when file matches a specified pattern”.

That said, there are known reliability issues with glob-based rule triggering. The team is aware, and your report helps raise visibility. You’re not the only user seeing this behavior.

A couple temporary workarounds:

  1. Switch to “Always Apply” and then limit the rule content conditionally, for example: “When working with *.tsx files in src/components/, follow these patterns: …”
  2. Use AGENTS.md in specific directories. These are auto-discovered when the agent works with files in that directory or its children. This is usually more reliable for directory-scoped instructions.

Also worth noting: the context usage tooltip may not always show every rule that was actually included. There’s separate feedback about the transparency of that indicator.

What version of Cursor are you on, and can you share an example of the glob pattern you’re using? That’ll help confirm whether it’s a pattern-matching issue or a more general triggering problem.

from what i can tell, glob pattern rules only get injected when the agent is actively working with files that match the pattern. so if you have a rule scoped to *.tsx files, it wont show up in context usage until the agent opens or edits a .tsx file in that session.

the “always apply” rules are the only ones that show up from the start. glob rules are more like “apply when relevant” which makes sense for keeping the context window clean, but it does mean the agent wont know about those rules until it hits a matching file.

if you want a rule to always be available regardless of what files are open, set it to alwaysApply: true in the frontmatter. otherwise the glob approach works, it just kicks in later in the workflow than you might expect.