Chat file link opens a different same-named file in the workspace

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When an agent reply mentions a bare filename such as INDEX.md, Cursor turns it into a file link. If the open workspace contains a different file with the same name, that link opens the workspace file. In the same turn, the Files Changed card lists the file that was actually edited, which can live in another repository outside the workspace.

Steps to Reproduce

  1. Open a workspace that contains plans/INDEX.md.
  2. Have the agent edit and commit an INDEX.md in a second repository that is outside that workspace.
  3. In the reply, the agent mentions the basename INDEX.md.
  4. Click the file link in the reply, then compare it with the INDEX.md row in Files Changed.

Expected Behavior

The inline link and the Files Changed row open the same file: the one the agent edited, outside the workspace. An absolute path in the same reply already links to the correct file. Only the bare basename is wrong.

Operating System

MacOS

Version Information

Version: 3.24.12
Commit: 37b865941ccb

For AI issues: which model did you use?

Grok 4.7

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @cscs, thanks for the clear write-up and repro steps!

I was able to reproduce this on my end. When a reply mentions just a filename like INDEX.md, Cursor looks for a file with that name inside the open workspace. It doesn’t take into account which files the agent edited, so the plans/INDEX.md in your workspace gets linked instead of the one the agent changed in your other repository. Full paths skip that lookup, which is why they open the right file. This isn’t caused by anything in your setup.

We’ve let the team know. In the meantime, a couple of workarounds:

  1. Open the edited file from the Files Changed card, or click a full path in the reply, instead of the bare filename.
  2. Ask the agent to always use full paths for files outside the workspace. To make that stick, add a User Rule under Customize → Rules, for example:
When you mention a file outside the open workspace, always write its full absolute path.

More on rules here: Rules | Cursor Docs . I’ll post here when there’s an update.