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).
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.
I am experiencing the same problem. It’s a regression that seems to have been introduced by Cursor’s “include third-party skills etc.” feature - historically, Cursor would only read AGENTS.md.
It’s a very common practice to create a symlinked CLAUDE.md pointing to AGENTS.md so it’s very widespread. I noticed it due to high context usage where a 5k token AGENTS.md was being loaded twice!
@deanrie your workarounds are not viable: it’s still important to import other third-party skills etc., and it’s not feasible to use a single canonical rules file in companies using mixed tooling, which is most of them. Unless you think you can convince your peers over at Anthropic to switch from CLAUDE.md to AGENTS.md?
The best workaround is probably to define CLAUDE.md contents simply as an alias: @AGENTS.md, however it is reasonable for this change to be rejected by those who prefer symlinks and think Cursor should just fix their bug.
Hey, thanks for confirming and adding more detail. You’re right, the earlier options don’t solve this for teams with mixed tooling where you need third party skills and you also can’t avoid CLAUDE.md. Can’t argue with that.
Your alias idea, a CLAUDE.md that includes @AGENTS.md instead of using a symlink, is honestly the most practical option available right now. CLAUDE.md stays minimal, so you avoid duplicating the full contents into context. It’s not ideal if you really want a symlink, but it works as a temporary workaround.
On the core issue, what you’re seeing isn’t intended behavior. Dedup is currently done by filename, not by actual file contents or inode, so both copies get injected. We’re tracking this issue, but I can’t share an exact ETA for a fix yet. I’ll reply in the thread when there’s an update.