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:
- Prompt-level instructions ("don't touch the originals") are not a security boundary; only OS-level permissions and sandboxing are. Long autonomous agent chains amplify a single path misjudgment into catastrophic damage, at machine speed.
- Anthropic's docs confirm that in acceptEdits mode, rm/rmdir can run automatically, and rm deletions can't be reverted via Checkpoints.
- Local Git lives in the same permission domain as source code, so it's not a backup. Recovery mechanisms must be fully isolated from the agent's failure domain (remote repos, snapshots, separate disks/cloud backups).
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.
More from coding & agent
- Swargs claims $50M+ transaction volume and 6,000+ listings on its AI agent marketplace — KyeGomezB · 2026-09-29
- Sonnet 5.5 effort settings make no difference in 15-task coding test: 9/15 at low, medium and high — every · 2026-09-29
- Claude Connectors: 7 essential integrations to stop copy-pasting between Claude and your apps — Aiden_Tech_Ai · 2026-09-29
- AI made building so cheap that 5 launches beat 5 months of thinking — alexmacgregor__ · 2026-09-29
- AI agent buys NBA tickets end-to-end, pivots on its own after seats sell out mid-checkout — armand_ruiz · 2026-09-29
- Embedded dev on Chinese models: DeepSeek and GLM are good enough, skip Codex/Claude — sven_ai · 2026-09-29