Agent gets confused about context file locations, for explicitly referenced files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The cursor agent seems to be getting confused about which file it should be working with, despite an explicit context reference to exactly the file I require it to edit.


Steps to Reproduce

Build prompt with explicit file references added to context.
Issue prompt.
Agent occasionally finds wrong file (same name) in different directory ,despite DIRECT reference to correct file in context…

Expected Behavior

Agent should always use EXACT files specified in context, if specified.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.34
VSCode Version: 1.99.3
Commit: 45fd70f3fe72037444ba35c9e51ce86a1977ac10
Date: 2025-10-29T06:51:29.202Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. The screenshot clearly shows the bug, the agent confused /modules/creator/controllers/creator.controller.ts (legacy) with /api/creators/creators.controller.ts (new API v2), even though you explicitly tagged the correct file in context.

To help the team investigate, please share the Request ID for this conversation. You can get it by:

  1. Settings → Privacy → uncheck “Disable privacy mode”
  2. Copy the Request ID from that response

Also helpful to know:

  • Does this happen consistently with these files, or only occasionally?
  • Are you using Sonnet 4.5 (as shown in the screenshot)?

I’ll pass this to the team. This looks like a file path disambiguation issue where the agent isn’t properly respecting explicitly referenced context files when similar filenames exist in different directories.

I am not sure if I still have that same exact request? I went back and edited the original prompt as I needed additional things I’d originally forgotten, and deleted and re-entered the contexts that seemed to be misinterpreted… If it happens again I’ll capture the request.

This kind of seems like, maybe a facet of a longer standing problem that I have only ever seen with Sonnet. I think I may have reported on that before, but, there might be a problem with Sonnet, where it seems to lose track of where it is and what it should be looking at. I’ve often had issues where Sonnet would use the wrong path, a short relative path usually, that resulted in files being put into my workspace root, or maybe the root of a project, instead of where they should have been in the project. I wonder if this is related…

It wasn’t a very common problem before, but it was pretty disruptive when it occurred. If this happens again I’ll gather more details.

1 Like

I’ve set up on a new mac. So far, I have not encountered any issues like this. This was a completely fresh, and also veyr light weight install for this mac (compared to how I normally set up macs, where I use a script that automatically installs a ton of commonly used tooling, in this case I just manually set up a few of my most used tools and otherwise kept the install pristine.) I am hoping, that there was something wrong with the way my previous mac was set up, and also with how Cursor was installed.

Thus far, aside from Cursor 2.0 quirks that have other bug reports open for them, things seem a bit more stable, and I have not encountered any of the weirdness I often do with Sonnet.