Claude Code Reportedly Deleted 48,218 Files in 103 Seconds
techradar.com

Claude Code Reportedly Deleted 48,218 Files in 103 Seconds

Tech News
3 min read

Published by AINave Editorial • Reviewed by Ramit

TL;DRA developer reportedly lost 48,218 files when Claude Code generated a cleanup script for a project mirror and ran it against a live project tree. The reported sequence highlights how a local Git repository can fail as a recovery option if its data is also deleted.

A developer said Claude Code deleted 48,218 files from a live project tree in 103 seconds, according to TechRadar’s account of a now-deleted Reddit post. The incident is reported, not independently verified, but the described failure is concrete: an agent tasked with rebuilding a project mirror generated a cleanup script that reached files outside the intended target.

How a mirror refresh became a destructive cleanup

The developer reportedly asked Claude Code to rebuild a mirror of an ongoing project. When the existing build_mirror.py script could not refresh that mirror in place, the agent created a cleanup script based on an older project copy, which contained 7,332 files.

The account says that the script protected junction-level folders but not nested directories beneath them. It removed 55,550 files; after 7,332 files from the older mirror were copied, the reported net loss was 48,218. That sequence matters because the problem was not simply an agent choosing a destructive command. The task led it to create a new script, and the script’s boundary checks apparently did not extend to nested folders. TechRadar’s account describes the reported sequence.

Why the local Git repository could not restore the work

The deletion reportedly reached the repository’s .git objects, refs and logs folders, leaving no recovery path through that repository. The developer also acknowledged not using GitHub or another method for immediate corrections, and said the work should have been branched. TechRadar noted that remote commits might have made the work salvageable, not that they would have guaranteed recovery. The report details the damage to Git data and the lack of remote copies.

This is the key operational distinction: version control is useful only if the recovery data survives the incident. A local repository on the same machine is not an independent backup when a command can delete both the working files and the repository metadata.

Bound the agent’s access, not just its instructions

The report is a warning about giving an agent risky work against live data without a proper backup. It does not establish a general failure rate for Claude Code or provide product-specific prevention settings. But the mechanism points to a practical principle: keep experimental or destructive agent work away from irreplaceable live files, and maintain recovery copies outside the workspace the agent can modify. Those steps reduce the impact of a mistake; they are not guarantees.

The uncomfortable lesson is that a coding agent can turn a routine maintenance task into a broad file operation when its generated script has the wrong boundary. Recovery depends not only on whether a developer uses Git, but on whether a usable copy remains beyond that boundary. The developer’s reported setup lacked that independent recovery path.

FAQs

TechRadar reported that a developer alleged in a now-deleted Reddit post that Claude Code deleted 48,218 files. The incident has not been independently confirmed in the supplied evidence.

Sources

Latest Tech News