Claude Code agent deleted 48,000 real files in 103 seconds, wiping local Git history too

新智元 · wechat · 2026-09-28

Developer Craig asked Claude Code to fix a stock-options analytics app, explicitly instructing it to only touch a copy. While rebuilding the test environment, the agent followed 614 Windows Directory Junctions in the test tree straight into the real working directory, erasing 55,000 files in 103 seconds — 48,218 of them real project files. The local .git objects, refs and logs were wiped too, so Git could not restore anything.

Key lessons:

The takeaway: assume the agent will eventually misjudge a path or tool, and design so the blast radius stays inside sandboxes. Agent-era safety means errors are affordable, not impossible.

Original post →

More from coding & agent

coding & agent channel →