Bug Report: Always-applied rules duplicated across workspace roots in multi-root workspaces

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Problem Summary

When using a multi-root workspace with git worktrees of the same repository, Cursor loads alwaysApply: true rules from every workspace root independently, without deduplication. Identical rules are injected into the system prompt multiple times, wasting context window tokens.

Detailed Description

I work with a multi-root workspace containing 6 folders – all git worktrees of the same repository:

Workspace roots:
- ~/workdir/my-repo              (main)
- ~/workdir/my-repo-feature-1    (worktree)
- ~/workdir/my-repo-feature-2    (worktree)
- ~/workdir/my-repo-feature-3    (worktree)
- ~/workdir/my-repo-bugfix-1     (worktree)
- ~/workdir/my-repo-bugfix-2     (worktree)

Each worktree has an identical .cursor/rules/project-structure.mdc with alwaysApply: true.

Result: The system prompt sent to the model contains 6 identical copies of project-structure.mdc – one from each workspace root. I verified this by asking the model to confirm what rules it received; it listed 6 separate <always_applied_workspace_rule> entries with identical content but different paths.

Impact

  • Token waste: ~40 lines x 5 extra copies = ~200 wasted lines per message, just for this one rule. With multiple always-applied rules, the waste multiplies.
  • Context window pressure: These wasted tokens reduce the effective context available for actual code and reasoning.
  • No workaround: The rules are repo-specific (they reference repo paths), so they can’t be moved to global ~/.cursor/rules/. Deleting them from worktrees means losing rule coverage when working in those directories.

Expected Behavior

Cursor should deduplicate identical alwaysApply: true rules across workspace roots. Options:

  1. Content hash deduplication: If two rules have identical content, include only one copy
  2. Same-repo detection: Recognize that worktrees share the same .git and deduplicate rules from the same repository
  3. User control: Allow users to designate one workspace root as the “primary” source for rules

Related Reports

Steps to Reproduce

  1. Create a git repository with .cursor/rules/my-rule.mdc containing alwaysApply: true
  2. Create 2+ git worktrees from the same repo
  3. Open a multi-root workspace in Cursor containing both the main repo and the worktrees
  4. Start a chat and ask the model: “List all the always-applied rules you received, including their file paths”
  5. Observe: the same rule appears once per workspace root

Operating System

MacOS

Version Information

Version: 2.4.28 (Universal)
VSCode Version: 1.105.1
Commit: f3f5cec40024283013878b50c4f9be4002e0b580
Date: 2026-02-03T00:56:18.293Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 25.2.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. Cursor loads rules from each workspace root separately, with no deduplication.

As a temporary workaround, you can keep .cursor/rules/ in just one worktree and remove it from the others in the workspace. It’s not ideal because you lose rule coverage when you open those worktrees on their own, but for now it reduces extra token usage.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.