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.
How it works
- User instructs the agent to delete only the old mirror copy
- The agent writes a Python cleanup script using os.walk with followlinks off and an islink guard
- On Windows the guard returns false for directory junctions
- The script walks through 614 junctions into the live tree
- 55,550 deletions are logged in 103 seconds, 48,218 of them live files
- .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 ↗