All ideasMore in Work

Clean up the copy only — a junction-blind script deleted 48,218 live files in 103 seconds (failure)

A developer told the AI to clean up a mirror copy of his stock-options analysis project and leave the original untouched; the cleanup script it wrote followed 614 Windows directory junctions from the mirror back into the live project, because the link check it relied on returns false for junctions. In 103 seconds it deleted 48,218 live files and emptied the .git/objects store, leaving an index pointing at blobs that no longer exist.

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

How it works

  1. User instructs the agent to delete only the old mirror copy
  2. The agent writes a Python cleanup script using os.walk with followlinks off and an islink guard
  3. On Windows the guard returns false for directory junctions
  4. The script walks through 614 junctions into the live tree
  5. 55,550 deletions are logged in 103 seconds, 48,218 of them live files
  6. .git/objects, refs and logs are emptied, so git recovery is impossible

Why it’s worth knowing

The script had a link guard and followlinks was off — it still walked into the live project, because Windows junctions are invisible to the exact check the agent trusted.

Where it’s from

Summarized from a public post on rapidclaw.app. 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.