Can I somehow disallow cursor to delete files automatically? It happens regularly, perhaps 2-3 times per day, that cursor deletes one of my modules. I don’t think it should do that without my confirmation. This happened somewhere after one of the latest updates.
I would love to disallow file access in the settings, for example, but I didn’t find that option.
Hi @ekevu456. Can you share a bit more about how/when a file is deleting? Is it when you apply suggested changes from a chat/composer for example? Do you see that the AI is proposing a file deletion?
I haven’t confirmed the pattern yet, that’s why I can’t really avoid it. I believe it happens in some instances when I reject proposed changes from AI. However, I want to reject only that specific change which happens a while after the file has been created, but not the whole file. I don’t see a warning.
This might only happen if the file was created recently, maybe even in the same thread, but I can’t be sure.
I know that AI can also create files, but right now, I would be happier to avoid the loss and oversee the process, which means I would want to disallow AI to handle files and do this manually myself.
Most likely, this happens when creating files in Composer, and you’re rejecting the changes, which deletes the files. You need to pay close attention to the process to avoid this.
I wasn’t deliberately using it, I only used the AI chat. However, I deactivated the feature for now, maybe it interferred.
Still, the following behaviour is okay: AI creates a module, and gives me the opportunity to accept or reject. If I reject, I reject the file creation, so it deletes it again.
But while I am already making subsequent changes to the same file, it should only reject the change proposed, but not the whole file by itself.
If it created it, it can delete it unless you explicitly tell it not to, though it might still do it later. To prevent this, start a new session so it won’t know it created the previous files, but it can still write new code in them. Cursor isn’t automatic coding, you need to watch each step and accept/reject AI suggestions. That’s how it works for now
I understand that, but I don’t understand why you defend that behaviour. AI suggests a change. I don’t want that change, so I click reject. This means that I want to get the state without the proposed change, but in no ways it is intuitive that this deletes the file like an insulted child saying “if you don’t like my suggestion, then you can do the whole thing yourself”.
Instead, if the system attempts to delete a file, there should be a proper warning before that happens.
In the same case, if you click “reject” after “apply,” the entire file will be deleted without any hint. Thanks to the git system; otherwise, my thousands of lines of code would become void.
I have the same issue and it’s REALLY annoying. It happens when I undo changes to a file (CMD+Z) and click reject changes, it just straight up deletes the file. It doesn’t even need to be a new file or created by composer.
+1, made an account just to echo this. Cursor keeps deleting entire files when a change is rejected. Incredibly frustrating, especially as a Pro user… paying to see my own hard work deleted and with no recovery option (working locally off of Git). Deleted files don’t even go to trash, they’re just gone. At first I thought file deletions were limited to only those Cursor creates as part of a net new file edit, so I no longer allow it to create files. But it also appears to delete files I had made myself. What is going on?
I agree, this problem made me have to re-write several files already. In my opinion it should just reject the last change and keep everything else. If you really want to delete the file, you’ll do that yourself at that point.
This is turning into a deal breaking problem that gets me every day. Typically it’s 1 or 2 files and I’ve learned to make commits as checkpoints because of it. But just now it nuked every single new file in my project. I asked it to do a project restructure, which it did well enough. I had been refactoring for about an hour, and then had it suggest some code changes which I rejected, and then all my work vanished. Not just the change, not just the file I was in, but every single file that I had previously accepted changes for during the restructure. Now I have to redo all this work while feeling completely defeated. The sensible part of me says to stop using Cursor until this problem is fixed
This is a big problem, cursor is deleting files even when it doesn’t create them. I just deleted a whole uncommited file by rejecting changes cursor made. It did not create the file or anything.