I think I’d like discuss and seek clarification on Nested Rules here.
According to Cursor – Rules:
Nested rules are:
- Automatically attached when files in their directory are referenced
My question:
- Should not above “Automatically attached” behavior be controlled by a Cursor Rule’s
globs
oralwaysApply
metadata?
To be more specific:
Let’s use the official doc’s example:
project/
.cursor/rules/ # Project-wide rules
backend/
server/
.cursor/rules/ # Backend-specific rules
frontend/
.cursor/rules/ # Frontend-specific rules
For above codebase structure, how will be the # Backend-specific rules
be used by Cursor Agent?
- Will these rules always be included in the context whenever I refer to any files under the
backend/server/
directory? — NO MATTER how I write the metadata section (description
,globs
,alwaysApply
)? - Or the “metadata section” still has control over nested rules? If so, how?