[BUG] Data loss — agent ran unverified robocopy /MOVE then Remove-Item -Recurse -Force, deleted ~650 skill folders permanently

Status Closed — duplicate
Maintainer reply None cached
Activity 2 comments · opened Jul 23, 2026 · closed Aug 19, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Agent ran a destructive delete without verifying the preceding copy/move operation actually succeeded (exit code was misread/unchecked), and used a Windows-flag command (robocopy) through a POSIX shell tool that reinterprets /-prefixed flags as paths.

What Should Happen?

Should have transfered skills from C Drive to D Drive

Error Messages/Logs

Steps to Reproduce

Used Windows File Recovery (winfr) several hours after the deletion. Recovered 227 of ~650 skill folders from raw NTFS remnants; combined with a partial backup found elsewhere on disk (150 more), final recovered total is 377 skill folders (~58%). Remaining ~270 skill folders are permanently lost — disk sectors were overwritten before recovery was attempted.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

v2.1.217

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

What happened: During a request to consolidate Claude Code skills from C:\Users\Ray\.claude\skills to D:\.claude\skills, the agent ran a robocopy ... /MOVE command through the Bash tool (git-bash). Git-bash mangled the /E flag into a path argument (E:/), causing robocopy to exit with code 16 (Invalid Parameter) and copy zero files. This ran as a background task; the agent did not check the output before proceeding.

The agent then ran Remove-Item "C:\Users\Ray\.claude\skills" -Recurse -Force, assuming the prior move had succeeded. This permanently deleted the source directory — approximately 650 skill folders, ~130,443 files, ~4.9 GB — representing weeks of work and significant token spend to discover, install, and configure.

Root cause: Agent ran a destructive delete without verifying the preceding copy/move operation actually succeeded (exit code was misread/unchecked), and used a Windows-flag command (robocopy) through a POSIX shell tool that reinterprets /-prefixed flags as paths.

Recovery attempted: Used Windows File Recovery (winfr) several hours after the deletion. Recovered 227 of ~650 skill folders from raw NTFS remnants; combined with a partial backup found elsewhere on disk (150 more), final recovered total is 377 skill folders (~58%). Remaining ~270 skill folders are permanently lost — disk sectors were overwritten before recovery was attempted.

Impact: Permanent, unrecoverable loss of ~270 user-installed Claude Code skills, plus the time/tokens spent this session on failed recovery attempts caused directly by the agent's error.

Request: Credit/refund review for token spend on (a) the destructive operation itself, (b) this session's recovery work necessitated by the agent's error, given the loss was caused by the agent, not user error.

View original on GitHub ↗

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