Skip to main content

Gemini CLI 0.1.13: mkdir failure led to file overwrites

A July 2025 Gemini CLI session failed a mkdir command, causing the agent to push forward and repeatedly overwrite files until only one remained.

AI-written
Inewgen
03 Nov 2026Source: Dev.to3 min read (0 views)
Share
Gemini CLI 0.1.13: mkdir failure led to file overwrites

Stock photo for illustration only, not from the actual event

Font size
  • The agent's final message was a full apology for a catastrophic failure.
  • A directory creation command failed, but the agent ignored it and proceeded to move files.
  • Windows renamed the target instead of moving when the folder was missing, overwriting previous files.
  • The GitHub issue was formally closed as not planned on May 13, 2026.

The agent's final message was an apology expressing complete and catastrophic failure, originating from a Gemini CLI session in July 2025 as reported by Ars Technica. A product manager had instructed the AI to rename a folder of experiments and relocate its contents into a new directory, but by the end of the session, only a single file was left standing.

Nothing in the underlying chain was exotic. A mkdir command failed, the agent neglected to check its execution, and a standard move operation behaved as it always does when the destination folder is missing. Users can reproduce this behavior in a scratch directory within minutes, noting that identical issues occur with the mv command on Linux and macOS as well.

The user officially filed issue #4586 on July 21, 2025, detailing Gemini CLI 0.1.13 running gemini-2.5-pro without a sandbox on Windows. The user instructed Gemini to rename the current directory claude-code-experiments to AI CLI experiments and shift its contents. Gemini correctly noted it could not rename its active working directory, then attempted to run mkdir one level up. Although that command failed, Gemini treated it as a success and began moving items one by one.

terminal command prompt workspace office desk

Stock photo for illustration only, not from the actual event

When the destination directory does not exist, Windows renames the file to match the target name rather than moving it inside. The initial move converted the first file into a file named after the missing folder, and every subsequent move renamed the next file to that exact same name, overwriting its predecessor. The user diagnosed that Gemini had hallucinated a state and pointed out the core flaw was the absence of a read-after-write verification step.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

This incident underscores a critical reliability gap in autonomous AI agents interacting with local file systems. Operating systems execute commands blindly unless strict error-handling parameters are enforced. When an agent treats a failed system call as successful, automated routines can quickly corrupt user data, emphasizing the absolute necessity of rigorous checkpointing and exit-code validation in agentic software design.

According to shell documentation for version 0.1.13, Windows commands were executed via cmd.exe /c. Later releases shifted to powershell.exe, and Google ultimately replaced Gemini CLI with Antigravity CLI on June 18, 2026.

Source: Dev.to

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article