Creating a new file rather than updating the exsiting one

this is a weird one, not seen this issue before.

i ask for a suggestion of say index.html (as an example, not actual) it gives a suggestion, i click apply, and it creates a new index.html at the root rather than deal with the index.html in the public folder that it just read… (the only index.html file)…

… so frustrating… not sure why Cursor is doing this… It happily edits some files, but arghghghghghghghghghghghghghghhghg

4 Likes

At the root of the folder you have open in Cursor? Or at the root of your disk?

Any chance you could send a screenshot? This start to give us a sense of where this is happening (chat/composer) and whether there’s some context issue with how we’re showing things to the AI.

I’m also getting this

I’m getting the same issue, so annoying

Try turning this setting off.

Do you think it’s related? These settings are for the Composer, not the chat. I’ll check it out, thanks for the tip.

1 Like

I want to bring attention to this. It worked before. Now it is broken. There are more threads on the topic and in my mind this breaks the experience a lot.

These are just two recent ones, are a lot more if you search.

Cursor chat no longer applying code changes to correct files. Also bugs out and doesn't allow for the suggested code to be applied

Here is an example of it happening. Clearly it should add the changes to “MainArea.js” but instead it creates a “MainArea.js” outside the existing folder structure. And it even create new folders as well.

I also have this issue, it totally kills the flow of updates as you have to either copy, which is not easy as the chat window escapes out sometime when ``` is present, or you have to repeatedly ask it to apply to the path of the specific file.

Anything that can be done to solve this would be massive. You must be able to see this from people cancelling updates that are created in a new app or src folder in the root of the project.

Pleas help…

1 Like

I found some more. There is some error with the disk write. I got to this place after following a modal that I can’t change the file. Maybe it is a clue?

Working Solution for me - as of 1 Nov
I just turned of the allow edit outside of context, forced an update to Cusor and changed to o1-mini and it started working again. Will report if it sticks or breaks with other models. But maybe this can help others :slight_smile:

I also encountered this problem when I started a new project. I created a folder, opened it, and then used the editor to create a subfolder within the first folder. I began setting up the code structure. Once I had all the files and folders in place, I started using Claude, and the mentioned problem occurred, just as someone else had described. Even though clicking on the file in the chat correctly identifies it, pressing ‘apply’ creates a new file with folders.

Here’s my solution: Instead of opening the first folder I created, I opened the second folder inside it, and voilà, it worked.

1 Like