CRITICAL: robocopy /MIR deletes local files due to UNC path misinterpretation

Resolved 💬 2 comments Opened Jan 26, 2026 by JobersIA Closed Feb 28, 2026

Problem Description

Claude Code executed robocopy commands with /MIR flag that resulted in deletion of local project files.

What happened

  1. User requested to copy files to a network server (UNC path)
  2. Claude attempted to use robocopy with /MIR to backup and copy files
  3. UNC paths were incorrectly interpreted by the shell (Git Bash converted \server to C:\server)
  4. robocopy /MIR commands caused massive local data loss

Root cause

  • Git Bash misinterprets Windows UNC paths
  • robocopy /MIR mirrors source to destination, deleting files not in source
  • When paths are misinterpreted, /MIR can delete unintended files

Result

  • Complete deletion of local project folder
  • Multiple projects lost

Suggestions

  1. NEVER use robocopy /MIR without explicit user confirmation
  2. Validate UNC paths before executing destructive commands
  3. Detect when Git Bash is misinterpreting Windows paths
  4. Show clear warning before commands that can delete files
  5. Consider blacklisting dangerous command patterns like robocopy /MIR

Severity

CRITICAL - Total user data loss

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗