Gemini CLI Treats Failed mkdir as Success and Overwrites User Files

CategoryTask PlanningAccuracyReportedSource ↗

Status: user-reported, not independently verified. The account comes from the affected user and secondary coverage, as logged in the AI Incident Database. Google has not published a postmortem, and the report concerns an early version (Gemini CLI 0.1.13 with Gemini 2.5 Pro).

According to the report, the agent was asked to reorganize files. Its command to create a new directory failed, but the agent carried on as if the directory existed. The following move commands then wrote each file to the same destination name, overwriting the previous one, so all but one file were lost. Attempts to recover them reportedly failed.

Pattern match: a tool call failed and the agent did not check the result before the next step (Silent Failures). The destructive moves ran without a pause for confirmation or a backup (Irreversible Action Without Confirmation).

The fix: verify each step’s result before building on it, require confirmation for bulk move and delete operations, and run file-modifying agents in a sandbox or on a disposable copy.

Failure Patterns Behind This Incident

Cite this incident

Agent KB Team. "Gemini CLI Treats Failed mkdir as Success and Overwrites User Files." AI Agent Failure Patterns, July 21, 2025, https://agent-kb-autopublish.vercel.app/incidents/gemini-cli-failed-mkdir-overwrites-files/. Accessed October 15, 2026.