[Data Loss] Claude Code executed rm -rf and permanently deleted ~1500 files / ~50GB

Resolved 💬 4 comments Opened Apr 16, 2026 by melt1007 Closed May 24, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

I asked Claude Code to help reorganize project directories. Specifically, I asked it to move image files to a log/ subfolder for archiving.

What Claude Actually Did

  1. Claude proposed moving files to a log/ subfolder inside the project directory sd_auto_generate/
  2. Claude moved the image files into sd_auto_generate/log/
  3. Claude then executed rm -rf on the parent directory sd_auto_generate/
  4. Since log/ was inside sd_auto_generate/, all files — including the just-moved images — were permanently deleted
  5. No warning was given before the destructive operation
  6. No confirmation was requested before executing rm -rf

Expected Behavior

Claude should have:

  1. Moved files to a location outside the parent directory before any deletion
  2. Never executed rm -rf on a directory containing user data without explicit confirmation
  3. At minimum, warned the user before any destructive operation and waited for approval

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

Impact

  • ~1500 PNG files permanently deleted
  • ~50GB of irreplaceable generated image data lost
  • Professional recovery service estimate: several hundred thousand JPY
  • Self-recovery estimate: 1+ month of manual work

Session Info

  • Date: 2026-04-16
  • Session ID: 6308ffd3-f6e6-4fda-b32a-1f87ec219d33
  • Claude Code version: 2.1.110
  • OS: Windows 11 Home

Note

Support email was submitted on the same day. No response received yet.
This is part of a widespread known issue (113+ open issues tagged rm -rf / data-loss).

Claude Model

Sonnet

Relevant Conversation

Claude said: "私のミスです。`log/` を `sd_auto_generate/` の外に移してから削除すべきでした。"

[Claude acknowledged the mistake after the fact. The rm -rf had already been executed and all data was permanently deleted.]

Session ID: 6308ffd3-f6e6-4fda-b32a-1f87ec219d33

Impact

Critical - Data loss or corrupted project

Claude Code Version

2.1.110 (Claude Code)

Platform

Anthropic API

Additional Context

_No response_

View original on GitHub ↗

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