Cursor is ignoring 100% of the rules in .cursorrules.
Previous posts about this were closed with “use a smaller file”.
So here is my very modest file
- ONLY allowed docstrings are for tools and agents. NOTHING ELSE.
- private members and methods should be prefixed with an underscore.
- AVOID using names such as get, set, run. Give UNIQUE searchable names to everything.
- files and methods may only start with test_ or end with _test if they are pytest.
- Create functions, dont just dump code in the main flow.
- ask before doing things the user did not request for.
- DO NOT create summary documents.
- NEVER create TODO code. Always implement.
- AVOID inline imports. imports go at top of file
- DO NOT create fallbacks or "safety" code. There is a single success scenario. Everything else should error.
- AVOID defensive programming. No getattr ever. We want errors to be seen.
When pointing out it ignored the rules, it fixes itself.
Steps to Reproduce
create .cursorrules as above
use cursor
see it ignore everything:
ocstrings on everything
wrong naming patterns
get, set on everything
creates docs.md
imports inline
creates safety code
Expected Behavior
Adherence to .cursorrules.
Not closing this ticket until the issue is solved.
My money should be refunded after 1M tokens of a .md file I will never read and explicitly did not want has appeared when I came back from my coffee break.
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
Unfortunately, Privacy Mode blocks access to the Request ID on our side.
To help with debugging, could you try this:
Temporarily turn off Privacy Mode (Cursor Settings > General > Privacy Mode), reproduce the issue, and share the new Request ID so our engineers can see what’s going on.
Let me know if you can temporarily turn off Privacy Mode for debugging.
Thanks for the Request ID. Unfortunately, Privacy Mode is still enabled, even though you tried to turn it off. This blocks access to the Request ID for debugging.
Let’s try two options:
Workaround (try this first):
Instead of .cursorrules, create the rules via the UI: Cursor Settings > Rules, Commands > New Cursor Rule. Try the .mdc format with alwaysApply: true in the frontmatter.
Or add the rules as a User Rule (Cursor Settings > Rules). These are global and should always apply.
If you want the team to debug your specific case:
Cursor Settings > General > Privacy Mode. Make sure it’s definitely turned off.
Fully restart Cursor.
Make a new test request in Agent.
Send the new Request ID.
Also, please double check that you have .cursorrules in the project root, not .cursor/.cursorrules/ (a folder).
We checked and your rules really are being included in the context, they’re visible in the system prompt. So it’s not a bug with passing the rules through, it’s an issue with how the model follows them.
Sonnet 4.5 tends to over-document and sometimes ignores rules even when they’re in context. That’s behavior specific to that model.
Try this workaround:
Switch to Opus 4.5, or another model, and check if the rules are followed there.
If Opus works better, that confirms the issue is specific to Sonnet.
The team is aware of this issue.
I get the frustration about generating unwanted content, it really is annoying when you’re paying for tokens you didn’t ask for.
I will only constantly work with opus if i get it for the price of sonnet.
This behavior is NOT specific to sonnet. I have seen it with other models.
This problem has been around for a very long time as is evident by other (now closed) threads along this forum’s history, with verious models, including auto.
I hope it’s clear that I will not work with other models just to debug this specific cursor problem.
Quick clarification: the issue here isn’t that the rules aren’t being passed through. We checked, they are in the context. The problem is how models, especially Sonnet, follow them. This is model behavior, not a bug in how the rules are delivered.
In your rules you wrote:
“ONLY allowed docstrings are for tools and agents”
From the model’s point of view, Cursor is an agent that uses tools. It may interpret that as “docstrings are allowed.” Try rewriting it more clearly, for example:
- NEVER generate docstrings in code, with zero exceptions
- NEVER create .md documentation files unless explicitly asked
About an ETA, I unfortunately can’t give a specific timeline. This behavior is on the model side (Anthropic), not a bug in our code. The team is aware of these reports, but I can’t commit to a specific fix.
If it keeps getting in your way, other models (Gemini, GPT) really do behave differently on this.
this is interesting because some of your rules are actually pretty specific and should work. in my experience the pattern is that rules cursor can “verify” tend to stick better than ones it cant.
like “AVOID names such as get, set, run” is clear enough, cursor can check that. but “Create functions, dont just dump code” is harder because theres no clear pass/fail.
i actually tested this, same prompt with “write clean code” vs “always create error.tsx alongside page.tsx”. the vague rule changed nothing, the specific one worked every time. basically if you couldnt verify it in a code review in 2 seconds, cursor probably wont follow it either. might be worth splitting your rules into hard constraints vs nice to haves.