Closing a chat restores deleted files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Files appear back into the project after you deleted them or the agent deleted them when you close a chat thread.

Steps to Reproduce

Start Agent chat, generate changes, the agent makes new files even when asked not to, ask it to delete them or delete them yourself, finish task, all good.

Close the Chat.

Files appear back into the project after you deleted them or the agent deleted them.

Expected Behavior

Files stay deleted.
Project stays clean.
Trash doesn’t accumulate.
Users keep paying.

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.30
VSCode Version: 1.105.1
Commit: 6b030be1a256f7464cbd98e48627a802a4831bf0
Date: 2025-12-17T06:31:05.530Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Linux x64 6.8.0-88-generic

For AI issues: which model did you use?

Grok Code

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey @vibe-qa!

We’re aware of a bug that reverses changes when you close a chat tab unless you’ve explicitly accepted the changes. Can you confirm that you aren’t expressly accepting the changes?

(For the most part, we’ve heard about this in the context of files reverting to how they were, not undeleting files, but it sounds very similar)

I am waiting for the chat to finish, in which I asked the Agent to delete the crap it created for no reason and with specific rules to prevent it, and delete the rest of the files it forgot about creating then closing the chat tab. This is confusing when multiple tabs address the same area of code, especially when reverting or retrying a reply in a separate chat that had no changes made, but included files that were changed in another chat. Every day a new surprise…

If you aren’t already using them, Git Worktrees might be a useful feature to prevent one chat from messing with the changes in another.

I am not using them because they are even buggier than using a single Agent.

Until you can make the forks communicate with each-other don’t assume that feature as a solution. Making parallel changes of small details and random file shuffling is a nightmare to merge at the moment.

The only sane method is to stash things immediately when I don’t see bugs or failures and revert everything when the agent goes off-road and try again and again reverting to that safe point.

Ok, another issue, for some reason the Agent emptied a json file, even though it showed full content in the text, it was wiped.

So naturally, I reverted by re-prompting.

And confirmed the Revert.

And guess what, the file was still empty, the data was lost.

It’s happening again, how can I prevent this?

Hey @vibe-qa

Let us know if you’re still facing the issue on 2.3 (rolling out to users still, but you can opt-in by selecting Cursor Settings > Beta > Update Track > Early Access.