Cursor double-counts symlinked files in Context Explorer (e.g. CLAUDE.md + AGENTS.md)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When a repo contains a file and a symlink pointing to the same content (e.g. AGENTS.md is a symlink to CLAUDE.md), Cursor’s Context Explorer shows both as separate entries and appears to include both in the context window, effectively doubling the token count for a single logical file.

Steps to Reproduce

Create a file AGENTS.md with ~5 000 tokens of content
Create a symlink: ln -s AGENTS.md CLAUDE.md
Open the project in Cursor and inspect the Context Explorer

Expected Behavior

Expected

Only one file’s content should appear in context (they resolve to the same inode).
Actual

Both CLAUDE.md and AGENTS.md are listed as separate entries, each contributing ~5 100 tokens (~10 300 tokens total).
Note

It’s unclear whether this is a visual/reporting bug or actual double-loading at the LLM level — either way it’s misleading and should be fixed. The symlink pattern is common in repos that need to support both Claude Code (CLAUDE.md) and other agents (AGENTS.md).

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Cursor [3.7.42]

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report with the screenshot and repro. This is a real bug, and it’s not just visual. AGENTS.md and CLAUDE.md resolve to the same inode, but rules deduping is done by filename, so both copies actually get injected into the context as alwaysApply rules. That’s why you’re seeing doubled tokens.

This is a known issue in the same class, missing dedupe for always-applied rules. I reported it internally as the symlink variant. I can’t share a fix timeline yet.

Workarounds for now:

  • Turn off the setting “Include third-party Plugins, Skills, and other configs”. Then CLAUDE.md will stop loading as a rule, and only AGENTS.md will remain.
  • Or don’t use a symlink and keep a single canonical rules file.

Note: .cursorignore doesn’t exclude CLAUDE.md from the rules loader right now, so it won’t help here.

Let me know if the workaround helped. I’ll post an update in the thread once there’s news on the fix.