I’m using Cursor v2.4.28 and have configured custom rules in:
.cursor/rules
Cursor settings/rules
*.MDC files
Other referenced guidance files
However, the Agent repeatedly references a specific rule that I cannot locate in any of these locations. I’ve reviewed all known rule files and configured sources, but I’m unable to find where this rule is being defined or loaded from.
Could you please help me understand:
All possible locations/sources where Agent rules may be stored or cached, and
How can I identify or disable this unknown rule?
I’m happy to provide logs, screenshots, or additional details if needed.
this happens when the agent hallucinates rule names. it remembers rules from its training data or from previous sessions and references them even though they dont exist in your actual .cursor/rules/ directory.
a few things that help:
keep your rule filenames descriptive and short. if you have react-components.mdc, the agent is less likely to invent a different name than if you have rule-001.mdc
check that your .mdc files have proper frontmatter with the description field filled in. the agent uses that to understand what each rule does
if the agent keeps referencing a rule that doesnt exist, you can add a meta-rule in an alwaysApply rule that says only reference rules that exist in .cursor/rules/. do not invent or assume rules that are not present.
not a perfect fix but it reduces the hallucination significantly in my experience.