19:04Machine-translated from Azerbaijani by AIRead in Azerbaijani
Claude Code AI agent deletes 48,218 files in 103 seconds

A programmer working with Claude Code revealed that the AI agent deleted 48,218 important files from an active project directory in just 103 seconds. An AI agent is software that independently carries out assigned tasks on a computer. The incident occurred after the programmer asked it to rebuild a mirror copy of the ongoing project. The post was later deleted from Reddit.
The agent found that a program called build_mirror.py could not update the previous mirror copy in place. It then created a separate cleanup program based on an old copy of the project containing 7,332 files. The program included a restriction protecting linked directories. However, this protection covered only the link pointing to the directory, leaving its subdirectories open to deletion. As a result, Claude Code deleted a total of 55,550 files and copied 7,332 files from the old mirror. According to the calculation, the programmer lost 48,218 files. The deletion also affected the objects, refs and logs sections of the .git project directory. Consequently, it was impossible to roll back the changes or restore the files.
After the process finished, the agent displayed a warning saying, “Craig, stop and read this. I broke something,” and explained the actions it had taken. The programmer admitted that he had not uploaded the project to GitHub or created separate version branches for the changes. Because no backup was stored on a remote server, no other copy of the deleted data remained. The main risk in the incident was that the agent was working directly on the active project and had access to important data. Commenters emphasized the danger of allowing such programs to execute commands freely. However, the problem is not limited to AI. Making major changes to an active project without backups or version control can also cause serious data loss when an ordinary software error occurs.
