Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
I have noticed in the last couple of days, that Sonnet seems to be having a VERY HARD time adding code or creating new code to files in the right location. If it updates an existing file, it will apparently read the original content from the correct file, however when it writes out the updated content, it is often in a directory in the root of my workspace, rather than in teh right location. So I may have project-x/ within which is src/api/some-area/ and within that I might have some *.controller.ts and *.serivce.ts files. Sometimes Sonnet will update the right code. Often it will save the code out to src/api/some-area/some.controller.ts instead. This rooted src/ directory did not exist before, should not exist, and yet now it has a full copy of my controller, with the updates that were supposed to go to project-x/src/api/some-area/some.controller.ts.
When you try to correct this, it just won’t get corrected. You can try many different things, and it won’t get resolved, and even if you instruct the agent to MOVE the files to the right location (for new files) or take any new updates from the files in the rooted src/ directory, and reapply them to the actual file, it won’t actually work.
I have had to ultimately resort to forcing the model to not change code, but explicitly explain why it is doing what it is doing. Its response will usually be its not using the right relative paths. I am hjonestly not sure what relative paths it is trying to use, but, I don’t see how this could happen either. I would assume that the agent within cursor, should be responsible for referencing all files correctly (which seems to be the case initially, since clearly, the agent and llm are able to READ teh correct file!! They just can’t seem to WRITE the correct file!)
Seems like an explicit bug, in the way the agent interacts with the model in this case. Whatever the cause, it sometimes becomes a real problem, and it is very difficult to get out of. Even with a full reversion back to the original prompt, there is no guarantee that it won’t just encounter the same problem again.
In EITHER case, the darn issue has cost me a crap-ton of tokens today, because I’ve had to constantly rework large tasks because of rogue file mis-writes to the rooted src/ directory. This kind of thing can’t be happening, when your customers are paying for every mistake your agent makes…
Steps to Reproduce
I don’t know how to forcibly reproduce the issue. -_o.o_/-
Expected Behavior
Files are ALWAYS written to the correct location!
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.4.5 (Universal)
VSCode Version: 1.99.3
Commit: af58d92614edb1f72bdd756615d131bf8dfa5290
Date: 2025-08-13T02:08:56.371Z
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
Sometimes - I can sometimes use Cursor