Hi everyone, I'm still pretty new to Cursor and I'm loving the agent mode for speeding things up. But I just had a bit of a scary moment and I'm hoping someone can help me figure out what went wrong.
I was working on a small React component and I asked the agent to refactor a function and clean up some unused imports. It seemed to do that just fine, but then I noticed one of my utility files was just... gone. Not in the trash, not modifiedβcompletely deleted from the project. I'm certain I never told it to touch that file. 😅
Has anyone else run into this? I'm still learning the ropes and I guess I trusted the agent a bit too much. Is there a local history or a recovery feature I'm missing? I've been relying on my own git commits, but I hadn't committed in a little while, so I'm kind of stuck.
More broadly, how do you all use agent mode safely? Do you turn it off for certain tasks, or are there settings I should check? I want to keep using it because it's amazing, but now I'm a bit nervous to let it run without watching every single step.
Oh yeah, that's a classic rite of passage with Cursor's agent. Been there! It sometimes gets overzealous when "cleaning up" imports and can decide a file is unused if it doesn't see an explicit import *in the open files* at that moment.
For recovery, check if your IDE or OS has a local file history. For example, VS Code (which Cursor is based on) has a "Local History" feature that can save you. You can also try a quick search in your system's Trash/Recycle Bin; sometimes deletions go there even if the project's trash doesn't show it.
> how do you all use agent mode safely?
My rule is to never run agent mode on a whole project or directory unless I've just committed. I use it strictly in the current file or with very explicit instructions like "only edit MyComponent.jsx". Turning off "auto-apply" in agent settings so it shows you a diff first is also a game changer. Gives you a chance to spot those surprise deletions before they happen.