Cursor crashing and modifying files unexpectedly, project partially wiped

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Hi Everyone,

I am trying to understand a serious issue I recently ran into with Cursor and would really appreciate any help or guidance.

Over the last few days, Cursor started crashing occasionally. After each crash, and even after some normal restarts, many files were suddenly marked as modified even though they had already been committed. On inspection, it appeared that empty lines or whitespace were being added to several files.

Yesterday, the issue escalated further. Large parts of my project were wiped or reverted, including major changes that had already been implemented. This resulted in significant data loss and required reworking a lot of code.

I am trying to understand what could cause Cursor to automatically modify files or restore an incorrect state after crashes or restarts.

Steps to Reproduce

1.	Open an existing Git repository in Cursor.
2.	Make changes and commit them successfully.
3.	Restart Cursor normally or when crash.
4.	Observe that many files show as modified even though no changes were made manually.
5.	In some cases, files appear reverted or partially wiped (Cursor adds an extra line).

The issue seems to occur intermittently but is strongly correlated with crashes or restarts.

Expected Behavior

Cursor should not modify or wipe files automatically after crashes or restarts.

Files that were previously saved by Cursor, but not explicitly edited by the user after restart, should remain unchanged. Cursor should not restore stale snapshots, inject whitespace, or overwrite files based only on an internal saved state without the user’s intent.

Crash recovery should never result in loss of locally saved work or unexpected file rewrites.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.43
VSCode Version: 1.105.1
Commit: 32cfbe848b35d9eb320980195985450f244b3030
Date: 2025-12-19T06:06:44.644Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 24.5.0

For AI issues: which model did you use?

Auto

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report.

The issue where Cursor automatically inserts blank lines on launch is a known bug, and the team is actively working on a fix. Many users have reported similar behavior (for example, here: The cursor adds blank lines).

Temporary workaround for the blank lines:
Open the modified files in the Source Control panel, click “Keep”, then remove the extra line manually. After restarting the IDE, the issue shouldn’t repeat for those files.

About the data loss:
That’s more serious. To help the team investigate, we’ll need:

  • Exact steps to reproduce the crashes
  • Which files were deleted or reverted (example paths)
  • Whether this happens while using Agent. If yes, please include the Request ID (Chat menu → Copy Request ID)
  • Whether the issue still happens with cursor --disable-extensions
  • Crash logs (if Cursor shows any)

Do you have Git history to recover the lost code? I’d recommend committing frequently while using Cursor until this is fixed.

thanks for the response. I had 100+ files which got wiped out . Finally i had to restore to the last commit and now reworking all the lost ones. I did email to support asking for help yesterday, however didnt receive any response.

  • Whether the issue still happens with cursor --disable-extensions

    • I will try that out

The window terminated unexpectedly (reason: ‘crashed’, code: ‘5’)

Thanks for the extra details. I understand losing 100+ files is a critical situation, and I’m really sorry that happened.

The blank-lines issue is a known bug (the team is working on a fix). But data loss with files rolling back is a separate, more serious issue that we need to investigate.

When you try cursor --disable-extensions, please let me know what happens. Also, this would help the team a lot:

  1. Were you using Agent when the crashes happened? If yes, can you share the Request ID (Chat menu → Copy Request ID)?
  2. Do you have any crash logs when you see: “window terminated unexpectedly (reason: ‘crashed’, code: ‘5’)”?
  3. Is there any pattern, like it only happens during certain actions (opening specific files, using Agent, etc.)?

About the support email, they usually reply, but there can be delays during holidays. If you have a ticket ID, please share it.

Temporary recommendation: make a git commit after each meaningful change to reduce the risk of data loss until this is fixed.

  1. Do you have any crash logs when you see: “window terminated unexpectedly (reason: ‘crashed’, code: ‘5’)”? → I dont have any . does cursor save any crash log? is there any steps u can share to capture the last crash log?

Thanks for the info. About the crash logs, you can find them like this:

Crash logs on macOS:

  1. Open Console.app (Applications > Utilities > Console)
  2. On the left, select “Crash Reports” or “User Reports”
  3. Look for files named “Cursor” with the crash date
  4. Or via Terminal: ls -lt ~/Library/Logs/DiagnosticReports/Cursor*

If you find the logs, please attach them here.

Temporary workaround for code 5 crashes:

Try clearing the Application Support settings folder (this will keep a backup):

cd ~/Library/"Application Support"
mv Cursor CursorBackup

Then restart Cursor. This helped other users with similar crashes: Cursor Crashing with error code 5 - Dec 14

mpsandeep@Mac ~ %  ls -lt ~/Library/Logs/DiagnosticReports/Cursor*
zsh: no matches found: /Users/mpsandeep/Library/Logs/DiagnosticReports/Cursor*
mpsandeep@Mac ~ % ls -lt ~/Library/Logs/DiagnosticReports
total 0
drwxrwx—  2 mpsandeep  _analyticsusers  64 13 Sep  2024 Retired
mpsandeep@Mac ~ % ls -lt ~/Library/Logs/DiagnosticReports/Retired
total 0
mpsandeep@Mac ~ %

crash.zip (318.8 KB) attaching few diag files which i found.

Please find the agent ID - 178a066e-6d90-46d3-9738-1791550eec64

1 Like

Team , Cursor crashed again and i lot the changes again. Its really wasting my time , efforts and money. Please help me to identify the issue and resolve it at the earliest

I’m really sorry to hear you lost data again.

This might be related to a large number of lint errors being returned by extensions.

A few questions:

  1. Which extensions do you have installed? I’m especially interested in linters (ESLint, Pylint, TSLint, etc.).
  2. Do you see a lot of lint errors or warnings in the Problems panel?
  3. Can you try running cursor --disable-extensions and using Cursor like that for a while?
  4. Can you temporarily turn off Privacy Mode? That will help our team diagnose the issue.

For now, to help protect your work:

  • Commit changes as often as possible (after each meaningful change).
  • Try clearing Application Support:
cd ~/Library/"Application Support"
mv Cursor CursorBackup

The blank lines issue is a known bug and the team is working on a fix.

where do i run this, i tried it on both mac terminal and in cursor terminal, but it didnt worked

cursor --disable-extensions

First, you need to install the Cursor shell command:

  1. Open the Command Palette: CMD+Shift+P
  2. Find and run: “Shell Command: Install ‘cursor’ command in PATH”
  3. After it installs, close and reopen your Mac system terminal

Then you can launch Cursor from the terminal with extensions disabled:

cursor --disable-extensions

Try using it like this for a few hours and see if the crashes stop.

Sure, will try this now.

Forgot to share what happens after every restart of cursor app

Before restart:
Counting objects: 100% (1/1), done.
Writing objects: 100% (1/1), 227 bytes | 75.00 KiB/s, done.
Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/mpsandeep/k8hci-ui.git

[new tag]           v0.9.0.11 → v0.9.0.11

✅ Done!
Commit: ⚠️  No staged changes. Analyzing unstaged changes…
backend
Tag: v0.9.0.11
mpsandeep@Mac k8hci-ui % git status
On branch image_build
Your branch is up to date with ‘origin/image_build’.

nothing to commit, working tree clean

After restart :

mpsandeep@Mac k8hci-ui %

History restored

mpsandeep@Sandeeps-MacBook-Air k8hci-ui % git status | wc -l
412

Followed this steps

Followed the steps to disable extension

Even after restart i see cursor is adding a new line to files

Prior to restart

Tried to restart twice and now cursor added 2 new lines

I still see these extensions

Thanks for the screenshots. I can see the blank lines issue still happens even with --disable-extensions, which suggests this is an internal bug.

Two questions:

  1. Have you tried clearing Application Support? This is an important step:
cd ~/Library/"Application Support"
mv Cursor CursorBackup

Then restart Cursor.

  1. Could you temporarily disable Privacy Mode? This will help the team diagnose the issue using your Request ID.

The whitespace issue is a known bug, and the team is actively working on a fix.

If I reset Cursor’s application data, does that mean it will lose its current understanding of my project and take extra time to relearn the code before giving good recommendations?

I’m also a bit worried about whether this could increase token usage. After dealing with a few crashes and an instance where some code was lost, it’s already cost quite a bit of time and money, so I want to be careful and avoid any more unnecessary overhead, both in time and cost.

Could you please confirm if this is the right approach and what the impact would be?

Good question. Let’s try a more targeted fix instead of fully clearing Application Support.

I recommend deleting only the state.vscdb file (make a backup first):

rm ~/Library/"Application Support"/Cursor/User/globalStorage/state.vscdb*

Then restart Cursor.

What will be removed:

  • UI state and window positions
  • Temporary state data

What will stay:

  • Chat history
  • Extensions
  • Codebase indexing and project context

This is a safer approach that has helped users with similar crashes, and it won’t delete your chat history.

Important:
Please temporarily turn off Privacy Mode (Cursor Settings > General > Privacy Mode). This is critical for the team to diagnose the issue using your Request ID.

Let me know what happens after you delete the file and restart.

I followed this step today, however app crashed again

ID : 3b350e11-9f46-4984-9113-fb06d5263f24