Files are overwritten with zero length at startup

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When Cursor IDE launches, it starts saving and syncing project files, which is visible in the notifications at the bottom and the file modification times. For some reason, Cursor Agent Windows launched and started doing something for a long time until it froze. The Open Cursor IDE button didn’t launch IDE. I ended up having to close the process through Task Manager. The next time I launched it, the same thing happened. The third time, everything launched, but I discovered that about 700 files had zero length. Subsequent analysis showed that these changes occurred within almost one second of launch. This is a specific issue. I didn’t have a full new backup; I managed to restore from a partial old backup and from local history, but I’m not completely sure that previous dialogs and formula changes were restored correctly. What should I do and how can I avoid this in the future?

Steps to Reproduce

Close IDE when launched in Task Manager.

Operating System

Windows 10/11

Version Information

Version: 3.12.29 (system setup)
VS Code Extension API: 1.128.0
Commit: cd1c87ff9b66021918fb9731605f8d1d5fd2f0b0
Date: 2026-07-21T03:26:05.811Z
Layout: IDE
Build Type: Stable
Release Track: Nightly
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Windows_NT x64 10.0.22631

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the detailed report. Losing files always hurts, I’m sorry.

What happened here: when Cursor starts, it can bulk re-save files that still have unaccepted agent edits (inline diffs), those “Saving / Writing into file” messages at the bottom. On Windows this save is non-atomic, so if you kill the process via Task Manager during that “storm”, some files can end up truncated to zero bytes. This is a known issue on our side, and I can’t share an ETA for a fix yet.

Recovery:

  • Local History (Timeline panel) is the right tool, and you already used it. Going forward, the most reliable option is git with regular commits, it’ll get you out of situations like this.

How to reduce risk until it’s fixed:

  • Before closing Cursor, accept or reject all pending agent edits Review changes → Keep All / Undo All. The re-save storm on startup only affects files with unaccepted inline diffs.
  • Don’t kill the process via Task Manager while the save notifications are active at startup. Let them finish.
  • Important: files.autoSave and files.hotExit don’t disable this write path, so don’t rely on them.

Also, the Agents Window freeze on startup that forced you into Task Manager is a separate issue. If it happens again, message me and we’ll dig in. Let me know how the recovery goes.

Are you saying I had at least 700 pending changes (given that 700 files were affected) and that what I restored from my local history isn’t up-to-date, and all my edits still need to be found, tested, and re-applied?

Two quick clarifications to your questions.

The 700 files are not 700 edits you made. They’re files with unresolved inline diffs that build up from session to session. Storm rewrote them with identical content, and the zeroing came from an interrupted write, not from lost edits. So you don’t need to re-find and re-apply changes. You just need the latest valid version of each file.

For bulk recovery doing it one by one via Timeline really is not r
ealistic:

  • With git: git restore . will restore all zeroed files back to the last commit in one go. This is the fastest path.
  • Without git: Local History is stored on disk at %APPDATA%\Cursor\User\History\ (each subfolder is one file, entries.json plus snapshots). From there you can use a script to extract the latest non-empty snapshot. Before you do that, make a copy of the History folder.

Let me know if you get stuck with the disk-level path.

Thank you. I already wrote in the first message that I restored it.

I discovered that this is all due to the Agents window being open, which resets files in all open projects (probably during indexing). Even if I close all project folders (dialogs) in the left-hand menu, one dialog still remains open.
How can I disable the Agents window?