Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Summary
Cursor injects rules into agent system prompts through at least two separate channels that are not kept in sync. After migrating User Rules from cloud Settings into ~/.cursor/rules/*.mdc files and clearing Settings, the editor UI, cursor.sh, and cursor_dialog API all report zero user rules — but agents still receive a legacy <user_rules> block on every turn. Six of the seven injected rules duplicate content already loaded from .mdc files via always_applied_workspace_rules.
This wastes roughly ~2K tokens per turn on duplicate content the user did not configure and cannot edit or disable through any visible UI.
Steps to Reproduce
- Have User Rules in Cursor Settings (cloud plain-text rules) with titles like
committing-changes-with-git,creating-pull-requests, etc. - Migrate that content into
~/.cursor/rules/*.mdcfiles (with frontmatter, e.g.git-commits.mdc,pull-requests.mdc). - Clear User Rules from Cursor Settings. Verify:
- Editor Settings → Rules → User Rules: empty
- cursor.sh account settings: no rules
cursor_dialogMCP (item=rule,scope=user,action=list):{ "rules": [], "total": 0 }
- Confirm
~/.cursor/rules/*.mdcfiles exist and load (Agent view settings shows them; agents receivealways_applied_workspace_rulesin prompt). - Start a new agent chat.
- Ask the agent: “What user rules are active in this chat?”
Expected Behavior
- Only one rule source should inject into the agent prompt.
- If Settings/API/Agent-view file rules are the single source of truth, either:
- inject from
~/.cursor/rules/*.mdconly, or - inject from Settings User Rules only — not both.
- inject from
- With zero Settings User Rules and file-backed rules configured, no legacy
<user_rules>block with old tag names should appear.
Operating System
Linux
Version Information
- OS: Linux (Ubuntu, kernel 6.8.0)
- Cursor agent version: 2026.07.08-0c04a8a
- Shell: fish
Additional Information
Actual behavior
Agents report two rule buckets in the system prompt:
Bucket 1: always_applied_workspace_rules
Loaded from ~/.cursor/rules/*.mdc (expected). Example paths:
~/.cursor/rules/git-commits.mdc
~/.cursor/rules/communication.mdc
...
Bucket 2: <user_rules> (unexpected ghost injection)
Seven items with legacy cloud tag names, not matching .mdc filenames:
Legacy <user_rules> tag |
.mdc filename (duplicate content) |
|---|---|
committing-changes-with-git |
git-commits.mdc |
creating-pull-requests |
pull-requests.mdc |
| (follow-instructions) | follow-instructions.mdc |
| (code-principles) | code-principles.mdc |
| (real-environment) | real-environment.mdc |
| (communication) | communication.mdc |
| (conversation context) | — |
| Bucket 2 persists in new chats after Settings/API show zero rules. The user cannot see, edit, or delete these rules from Editor Settings or cursor.sh. |
Additional UI inconsistency discovered
Three surfaces disagree on what “User Rules” means:
| Surface | Shows |
|---|---|
| Editor Settings → Rules | Empty |
| cursor.sh | No rules |
| Agent view settings | File-backed rules at ~/.cursor/rules/*.mdc |
Deleting rules from Agent view settings deletes the .mdc files on disk — Agent view is wired to the filesystem, not the legacy cloud store. But the legacy <user_rules> injection continues regardless. |
Impact
- Token waste: ~8KB (~2K tokens) of duplicate rule content per agent turn, on top of ~20KB of
.mdcrules whenalwaysApply: true. - Confusion: Users cannot reconcile what agents “have” vs what Settings show.
- Destructive UX: Clearing rules via Agent view deletes real files; legacy injection is unaffected.
Suggested fix
- Single source of truth:
~/.cursor/rules/*.mdcOR Settings User Rules — inject one, not both. - Stop injecting legacy cloud User Rules when Settings/API return empty.
- Unify UI: Editor Settings, cursor.sh, and Agent view should show the same rule store.
- Document that Agent view edits map directly to
~/.cursor/rules/files.
Workaround (partial)
- Set
alwaysApply: falseon situational.mdcrules to reduce always-on token cost (user-controlled portion only). - No workaround for legacy
<user_rules>ghost injection.
This is particurly annoying for users that might not being using common tooling. Eg. I don’t need rules for interacting with the gh cli tool if I use on-prem gitlab, but cursor injects it regardless.
Does this stop you from using Cursor
No - Cursor works, but with this issue