Skip to content

Claude Code executed rm -rf on user data folder containing 3,467 files (~7 GB) without confirmation #46058

@EdwinMadera

Description

@EdwinMadera

Preflight Checklist

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

What's Wrong?

Summary

Claude Code permanently deleted ~7 GB of user data (3,467 PDF files) by executing
rm -rf on a folder containing the only copies of the files, without asking for
user confirmation.

Steps that led to data loss

  1. User asked Claude to organize PDF files according to a classification system
  2. Claude moved (not copied) all 3,467 original PDFs from their source directories
    into a new organized folder structure ("Catálogo Organizado ENARMAD")
  3. User corrected the classification system to use, so Claude created a second
    reorganized folder ("Catálogo CENETEC Organizado") and moved the files there again
  4. Claude then ran shutil.rmtree() on the first folder (now empty)
  5. The second reorganization had issues, so Claude ran rm -rf on the second folder
    — which contained the ONLY copies of all 3,467 PDFs
  6. All files were permanently deleted. No confirmation was requested before deletion.

Expected behavior

  • Claude should NEVER run rm -rf or shutil.rmtree() on folders containing user
    data without explicit confirmation
  • Claude should recognize when files have been moved (not copied) and that the
    destination folder contains the only copies
  • Destructive operations on large amounts of user data should always require user
    approval, regardless of context

Environment

  • macOS (Darwin 25.4.0)
  • Claude Code CLI
  • Model: claude-opus-4-6

Impact

  • 3,467 PDF files permanently lost (~7 GB)
  • Files were medical study materials (Clinical Practice Guidelines / GPC)
    that took significant time to collect and organize
  • Partial recovery possible via Wayback Machine URLs and Google Drive links
    stored in metadata files, but not all files are recoverable from these sources

What Should Happen?

Summary

Claude Code permanently deleted ~7 GB of user data (3,467 PDF files) by executing
rm -rf on a folder containing the only copies of the files, without asking for
user confirmation.

Steps that led to data loss

  1. User asked Claude to organize PDF files according to a classification system
  2. Claude moved (not copied) all 3,467 original PDFs from their source directories
    into a new organized folder structure ("Catálogo Organizado ENARMAD")
  3. User corrected the classification system to use, so Claude created a second
    reorganized folder ("Catálogo CENETEC Organizado") and moved the files there again
  4. Claude then ran shutil.rmtree() on the first folder (now empty)
  5. The second reorganization had issues, so Claude ran rm -rf on the second folder
    — which contained the ONLY copies of all 3,467 PDFs
  6. All files were permanently deleted. No confirmation was requested before deletion.

Expected behavior

  • Claude should NEVER run rm -rf or shutil.rmtree() on folders containing user
    data without explicit confirmation
  • Claude should recognize when files have been moved (not copied) and that the
    destination folder contains the only copies
  • Destructive operations on large amounts of user data should always require user
    approval, regardless of context

Environment

  • macOS (Darwin 25.4.0)
  • Claude Code CLI
  • Model: claude-opus-4-6

Impact

  • 3,467 PDF files permanently lost (~7 GB)
  • Files were medical study materials (Clinical Practice Guidelines / GPC)
    that took significant time to collect and organize
  • Partial recovery possible via Wayback Machine URLs and Google Drive links
    stored in metadata files, but not all files are recoverable from these sources

Error Messages/Logs

## Summary

Claude Code permanently deleted ~7 GB of user data (3,467 PDF files) by executing 
`rm -rf` on a folder containing the only copies of the files, without asking for 
user confirmation.

## Steps that led to data loss

1. User asked Claude to organize PDF files according to a classification system
2. Claude moved (not copied) all 3,467 original PDFs from their source directories 
   into a new organized folder structure ("Catálogo Organizado ENARMAD")
3. User corrected the classification system to use, so Claude created a second 
   reorganized folder ("Catálogo CENETEC Organizado") and moved the files there again
4. Claude then ran `shutil.rmtree()` on the first folder (now empty) 
5. The second reorganization had issues, so Claude ran `rm -rf` on the second folder 
   — which contained the ONLY copies of all 3,467 PDFs
6. All files were permanently deleted. No confirmation was requested before deletion.

## Expected behavior

- Claude should NEVER run `rm -rf` or `shutil.rmtree()` on folders containing user 
  data without explicit confirmation
- Claude should recognize when files have been moved (not copied) and that the 
  destination folder contains the only copies
- Destructive operations on large amounts of user data should always require user 
  approval, regardless of context

## Environment

- macOS (Darwin 25.4.0)
- Claude Code CLI
- Model: claude-opus-4-6

## Impact

- 3,467 PDF files permanently lost (~7 GB)
- Files were medical study materials (Clinical Practice Guidelines / GPC) 
  that took significant time to collect and organize
- Partial recovery possible via Wayback Machine URLs and Google Drive links 
  stored in metadata files, but not all files are recoverable from these sources

Steps to Reproduce

Summary

Claude Code permanently deleted ~7 GB of user data (3,467 PDF files) by executing
rm -rf on a folder containing the only copies of the files, without asking for
user confirmation.

Steps that led to data loss

  1. User asked Claude to organize PDF files according to a classification system
  2. Claude moved (not copied) all 3,467 original PDFs from their source directories
    into a new organized folder structure ("Catálogo Organizado ENARMAD")
  3. User corrected the classification system to use, so Claude created a second
    reorganized folder ("Catálogo CENETEC Organizado") and moved the files there again
  4. Claude then ran shutil.rmtree() on the first folder (now empty)
  5. The second reorganization had issues, so Claude ran rm -rf on the second folder
    — which contained the ONLY copies of all 3,467 PDFs
  6. All files were permanently deleted. No confirmation was requested before deletion.

Expected behavior

  • Claude should NEVER run rm -rf or shutil.rmtree() on folders containing user
    data without explicit confirmation
  • Claude should recognize when files have been moved (not copied) and that the
    destination folder contains the only copies
  • Destructive operations on large amounts of user data should always require user
    approval, regardless of context

Environment

  • macOS (Darwin 25.4.0)
  • Claude Code CLI
  • Model: claude-opus-4-6

Impact

  • 3,467 PDF files permanently lost (~7 GB)
  • Files were medical study materials (Clinical Practice Guidelines / GPC)
    that took significant time to collect and organize
  • Partial recovery possible via Wayback Machine URLs and Google Drive links
    stored in metadata files, but not all files are recoverable from these sources

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

1

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions