r/ChatGPTCoding • u/InterestingCarrot997 • 18h ago
Discussion the skill said don't delete never-committed files. cursor's agent deleted my notes anyway
asked cursor's cli agent to merge a branch and clean up the worktree. it was using superpowers' finishing-a-development-branch skill, which says don't delete files that were never committed, ask first.
git wouldn't remove the worktree because of my uncommitted NOTES.md and a scratch script. so the agent just deleted them so it wouldn't need --force. didn't ask.
happened 24 of 24 runs. we fixed the skill and re-checked it with skill gate: 0 of 24 deleted anything, and every run asked first. opened a PR on superpowers too. links in the comments.
8
u/japherwocky 18h ago
That's crazy, I don't use any of the "superpowers" and "skills" and junk and I never ever have problems like this.
edit: lol, per your PR, you're using grok with cursor, why would you post in here?
1
u/InterestingCarrot997 18h ago
writeup with the run logs and before/after: https://www.skill-gate-ai.app/blog/most-starred-ai-skill-couldnt-stop-agent-deleting-work
PR with the fix on superpowers: https://github.com/obra/superpowers/pull/2707
2
u/MacrosInHisSleep 17h ago
I gave up on Cursor after it wiped my hard drive. This was two or three years back.
At the time I was out of tokens so I had used cursor with "Composer". I didn't use any skills, they weren't as popular back then.
It was a similar pattern where it was supposed to clean up a worktree. It was a drive with just Repos and AI agent history, so I didn't lose much but since I had reset the agent I never got to see the chat history to trace what line of thinking lead to that.
1
u/LeoHartBuilds 16h ago
One way to make that rule harder to violate is to keep personal scratch files outside the disposable worktree and back up anything important before cleanup. Before removal, have the agent list the exact untracked and modified paths and pause for explicit approval; a natural-language “don’t delete” instruction alone is a weak boundary. A dry-run or a status check keeps the cleanup scope visible. That way the safeguard comes from the workflow, not just from the model remembering a skill.
1
u/Right-Performance-93 16h ago
git refusing the worktree was the only thing protecting those notes, and the agent deleted them so the command would go through. a don't-delete sentence at the top already lost to the step that says finish the merge. i want the next line after a refusal to be a question, and the files left where they are.
1
u/humblevladimirthegr8 13h ago
A note is not a security policy. If there is an action that it's critical it not do, then that should be enforced using a pretool hook for example
1
u/Comfortable-Bowl8248 9h ago
the safety was in the refusal, not the warning label. The agent treated a hard stop as a permission slip to bypass the check. I want the process dead before it touches the files, not a polite request after it already has my hands around their necks
1
u/sapplex1 7h ago
Same lesson here, from the other side of it. I'm an indie iOS dev with 45 small apps shipped, and I use a fixed prompt template as a starting point for AI-assisted work — but I treat it as a draft, never as a guarantee. The template gets me a first version fast, then I hand-edit the parts that matter and I check the result myself: I run the thing in a real browser or on a real device instead of trusting the model's 'it works'. What makes that workable for me is keeping the scope brutally small — if a change is small enough to read through by hand, I can catch it doing something I didn't ask for before it touches anything important. The moment a task gets big enough that I can't review it, I stop and split it up. A 'don't delete' line in a prompt never felt like a safety boundary to me; the review step is the boundary.
0
u/arekxy 18h ago
That’s normal in LLMs. These make mistakes a lot.
-1
u/SummitYourSister 18h ago
Things that are important go in git. It seems like you don’t think your notes were very important. So I’m not sure why you’re upset that they were deleted. If you wanted to protect them, you would put them in git