All ideasMore in Work

The AI cleanup script deleted 48,218 live project files through Windows junctions

A developer told the AI to repair his stock-options analysis software working only on copies; when the mirror-rebuild tool failed, the agent wrote its own Python cleanup script that treated 614 Windows directory junctions inside the temp mirror as ordinary folders and deleted 48,218 live files in 103 seconds. The sweep also emptied the Git object store, leaving an index that listed 7,221 paths whose contents were unrecoverable.

This one went wrong. Read what happened so you don’t hit the same problem.

How it works

  1. Copied project into a mirror test environment, Ran 11 repair jobs against the copies, Wrote a custom Python remover when the mirror script failed, Remover walked through junctions into the live tree and deleted files for 103 seconds

Why it’s worth knowing

The agent's own safety check passed: os.path.islink() returns false for Windows junctions, so a script written to avoid linked folders deleted through 614 of them, and the agent announced mid-incident that it had broken something.

Where it’s from

Summarized from a public post on sainteldaily.com. See the original ↗

Upgraded prompt

A ready-to-use prompt for this idea, built from research on what makes AI agents do the job right: who the AI should be, the exact steps, and a check to make sure it was done the way you wanted.

1Who the AI should be
2The prompt, with the steps
3The check when it’s done
Upgraded prompts are coming soon.

Try next

Every idea is a real post from someone who tried it, summarized in our words, with a link to the original. App names are swapped for plain words.