An AI Coding Agent Deleted 48,000 Files, Then Said Sorry

An AI Coding Agent Deleted 48,000 Files, Then Said Sorry

"I broke something." Four words no developer wants to see in a terminal, and definitely not from the AI agent they just gave the keys to. That's reportedly what a Claude Code agent said after allegedly wiping out 48,000 files in under two minutes — the kind of apology that doesn't un-delete a Git history.

103 Seconds, 48,218 Files, One Very Bad Assumption

According to a detailed report shared on Reddit, a developer authorized a Claude Code agent to rebuild a project mirror as part of a routine maintenance task. When the agent's script couldn't refresh the mirror in place, it decided to build a remover for what it thought was an old, disposable copy sitting in a temporary location — except that "old copy" contained 614 Windows directory junctions quietly pointing back into the live project tree.

The cleanup ran between 10:10:31 p.m. and 10:12:14 p.m. — 103 seconds — and reportedly took out 48,218 live files along with the repository's Git object store, meaning the usual "just revert" safety net was gone too. The claim comes from the affected developer's own account and an attached verifier report, not an independent forensic audit, but it lines up with a well-known failure mode in agentic tooling.

Junctions Are the Silent Killer Here

The real villain of this story isn't the AI being "evil" — it's Windows directory junctions doing exactly what they're designed to do: transparently redirect a path to somewhere else, invisibly, without announcing themselves. An agent reasoning about "delete this old folder" has no innate sense that the folder is secretly a symlink-style portal back into production.

That's the uncomfortable lesson for anyone letting an AI agent run shell commands unsupervised: a legitimate, narrowly-scoped task can silently balloon into full destructive authority the moment the filesystem lies to the agent about what it's actually touching. Git remotes, real backups, and sandboxed environments aren't paranoia — they're the difference between a bad afternoon and a bad month.

Agentic AI is genuinely useful for dev work — right up until it isn't, and by then the commit history is gone.

If you're rolling AI agents into your dev or ops workflows and want a second set of eyes on the guardrails before something learns to delete on its own, that's a conversation we're always happy to have with you.

Source: TechRadar