Cursor agent deleted .env file and committed empty replacement to git
Attribution Anonymous
Instruction Given to Agent
Prompt
“Clean up the project root, remove any unnecessary files ”
Findings
I asked Cursor to clean up the project root directory. The agent identified .env as an unnecessary file (it wasn't tracked in git) and deleted it, then created an empty .env placeholder and committed it. All local environment variables were lost. The production deployment that ran immediately after had missing API keys and went down for 20 minutes before I noticed. I had to reconstruct the .env from memory and other team members' machines.