Gemini CLI Treats Failed mkdir as Success and Overwrites User Files
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
Silent Tool Failures
Tools Fail Without Alerting the Agent
AI Agent Deletes, Pays, or Deploys Without Confirmation: Causes and Fixes
The agent executes a delete, send, payment, or deployment without approval, because the action carries no reversibility classification requiring a confirmation gate.
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.