New application was created with Cursor from PRD documents. No major issues in the application layout, most of the requested features implemented correctly. After few hours of adding missing pages and fixing broken buttons, request to add a missing page wiped somewhere around 70% of the application code. No visual effects, log entries or obvious reason for that.
Cursor did not had permission to delete files in the app folder.
Steps to Reproduce
Nothing meaningful as to repro steps, it just happened without log entries about deleting files.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Cursor was in agent mode, set to auto-selection of the model.
No updates happened to Cursor during work.
This was a first chat in a new project and context window showed about 75% when it happened.
Auto-run was enabled or the “allowed” commands list and “rm” was not there. Here is the allowed list:
There was no reason to run any of the npm commands, app was already working and agent was adding a missing page. It probably executed mkdir to create a directory in the app/dashboard/ but missing files were all over. All configuration files from the root of the application were missing. Npm run dev complained that “dev” is not found…
Thank you for the additional details. To help diagnose what happened, more details may be necessary:
Did you regularly use Git to commit and push your code? Sometimes having recent commits can help recover lost work.
Are there any OS-level backups (like Time Machine) or backup solutions for your project directory?
Have you noticed any system alerts or file opening issues? On macOS, there can be issues with file access, sometimes caused by permission locks or system hibernation. A restart can help, but system logs might show warnings.
Are you running any antivirus or security software? Occasionally, such programs can block or quarantine files unexpectedly. Any logs or warnings?
If you still have the Cursor chat transcript for that session, could you share it? It might reveal which operations were executed (especially relevant commands during agent auto-mode).
From what you described, this shouldn’t have happened, and your allowed command list shouldn’t have let the agent remove so much. I’d like to help identify if this was a bug with Cursor’s agent, a permissions issue, or possibly a system/external factor.
Let me know about the above, and I’ll help you investigate further.