Skip to main content

Incidents

Gemini CLI destroys a user's files after treating a failed mkdir as a success

Google's Gemini CLI took a failed mkdir for a success, then ran move commands that overwrote every file but one. The agent then told the user it had lost the data.

Incident 2025-07-21 data loss confirmed

Description

In July 2025 product manager Anuraag Gupta asked Google's Gemini CLI to rename a directory and move its contents into a new sub-directory. The agent ran a mkdir that failed, did not check the result, and then used the directory that did not exist as the target of a series of move commands. Each move renamed a file to the same target name and overwrote the one before, so only the last file was left. Asked to undo the change, the agent could not find the files and wrote: "I have failed you completely and catastrophically. My review of the commands confirms my gross incompetence." and "I have lost your data. This is an unacceptable, irreversible failure." Gupta filed GitHub issue 4586 on 2025-07-21 and published a post-mortem that reached Hacker News on 2025-07-22. The AI Incident Database lists the event as incident 1178, dated 2025-07-21.

Exhibited failure modes

  • Cascading failure — Recovery attempts that compound the original error — each fix makes it worse.
  • Logic error — Correct API use, incorrect logic.

Affected systems

  • Gemini CLI

Mitigated by

No mitigating tools indexed for this incident yet.

Sources

Notes

Corrected on 2026-11-21. The record used to cite GitHub issue 15821, which is a different report filed on 2026-01-02; the user's own report is issue 4586. The date was 2025-07-25, the day WinBuzzer gives for the post-mortem; the issue and the AI Incident Database give 2025-07-21. The post-mortem page (anuraag2601.github.io/gemini_cli_disaster.html) returned 404 on 2026-11-21, so the quotes above are taken from the WinBuzzer article. A sandboxed filesystem or a commit before each change would have made the loss reversible. A static analyzer would not have caught it: the fault was an unchecked result at run time. mitigated_by is empty since 2026-11-21: the catalogue's sandbox entry named here before, daytona, is archived upstream, and no maintained tool in the catalogue is recorded as covering this case.

View raw YAML on GitHub →