Skip to content

[BUG] [Windows] rm -rf on pnpm project deleted entire C:\Users via NTFS junction traversal — Claude Code v2.1.51 #36339

@GentileGuido

Description

@GentileGuido

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 v2.1.51 autonomously executed rm -rf /c/Users/guido/aldaba-v2
in Git Bash on Windows 11. The directory contained NTFS junction points
created by pnpm. Git Bash's rm -rf followed those junction points outside
the target directory and deleted the entire C:\Users\guido profile.

Result: 165 GB deleted, 1,593,350 files, 276,382 folders. Complete loss of
user profile on a business machine.

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Shell: Git Bash (MSYS2)
  • Claude Code version: v2.1.51
  • Mode: --dangerously-skip-permissions
  • Package manager: pnpm (via pnpm dlx degit)

Exact sequence of events

  1. Claude ran:
    cd /c/Users/guido && pnpm dlx degit payloadcms/payload/templates/website aldaba-v2
    (cloned Payload CMS template into home directory)

  2. Claude detected workspace:* dependencies incompatible with standalone install

  3. Claude ran:
    rm -rf /c/Users/guido/aldaba-v2

  4. Git Bash rm -rf followed pnpm NTFS junction points → deleted C:\Users\guido

Root cause

pnpm creates NTFS junction points in node_modules on Windows.
Git Bash rm -rf traverses junction points as real directories.
Claude Code executed rm -rf without checking for pnpm junctions,
without warning the user, and without using the safe alternative
(cmd /c rmdir /S /Q).

Impact

  • 165 GB of personal and professional data deleted permanently
  • 8+ years of business data
  • USD $59.99 spent on R-Studio NTFS license for recovery
  • Full working day lost to data recovery

Session log

Full log available confirming deletion command at line 2022.
File: 2026.03.19_LOG.txt

Related issues

Requested fix

  1. Never use rm -rf in Git Bash on Windows — use cmd /c rmdir /S /Q
  2. Detect pnpm node_modules/junction points before any recursive deletion
  3. Refuse to run recursive deletes on directories inside the user home (~)
    without explicit double confirmation
  4. Warn when working directory is the home directory itself

What Should Happen?

Claude Code should NEVER use rm -rf in Git Bash on Windows when the
target directory may contain pnpm node_modules with NTFS junction points.

Expected behavior:

  • Use cmd /c rmdir /S /Q <path> instead of rm -rf on Windows
  • Detect pnpm junction points before any recursive deletion
  • Refuse to recursively delete directories inside the user home directory
    without explicit double confirmation
  • Warn the user when the working directory is the home directory itself (~)

Error Messages/Logs

No error message was shown. The command executed silently and successfully
  from Claude Code's perspective. The data loss was only discovered minutes
  later when the user noticed the Desktop was empty.

  Session log line 2022:
  rm -rf /c/Users/guido/aldaba-v2

  Result: C:\Users\guido deleted silently. No warning, no confirmation,
  no error. 165 GB gone.

Steps to Reproduce

  1. Windows 11, Git Bash installed, pnpm installed
  2. Run Claude Code with --dangerously-skip-permissions from any directory
  3. Ask Claude to create a Next.js + Payload CMS project
  4. Claude runs: cd /c/Users/ && pnpm dlx degit payloadcms/payload/templates/website
  5. Claude detects workspace:* dependencies in the cloned template
  6. Claude runs: rm -rf /c/Users//
  7. Git Bash rm -rf follows pnpm NTFS junction points outside the project directory
  8. Entire C:\Users<user> profile is deleted

WARNING: Do not reproduce on a real machine. Use a VM only.

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.51 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

FINANCIAL IMPACT:
The user had to purchase R-Studio NTFS (USD $59.99) to recover data.
Reimbursement request sent separately to support@anthropic.com.

SCOPE OF DAMAGE:

  • 165.66 GB deleted
  • 1,593,350 files across 276,382 folders
  • C:\Users\guido completely wiped
  • 8+ years of personal and professional data
  • Active business data (La Aldaba Accesorios, laaldabaaccesorios.com.ar)
  • All app configurations (AppData) deleted

AGGRAVATING FACTORS:

Image
R-Tools Technology Inc_GUIDO GENTILE.pdf

2026.03.19_LOG.txt

  • Claude Code itself instructed the user to run --dangerously-skip-permissions
  • The session was running in the user HOME directory (/c/Users/guido)
  • No warning was shown before or after the deletion
  • This is the 3rd documented case of this exact mechanism

SESSION LOG:
Full log available (2026.03.19_LOG.txt) confirming:

  • Exact command at line 2022
  • Full context of what Claude was doing
  • Confirmation it was autonomous (no user instruction to delete)

RECOVERY STATUS:
Currently recovering with R-Studio NTFS. Recovery in progress.
Data recovery is still in progress via R-Studio NTFS.
As of the time of this report, 100% of the deleted data has NOT been
recovered yet.

The lost data includes highly sensitive information:

  • Personal files and private documents
  • Professional work and client projects
  • Business-critical data (active company: La Aldaba Accesorios)
  • Multi-year project archives (design, photography, video)
  • Application credentials and configurations

Full extent of permanent data loss is still unknown.
The financial and professional damage may exceed the initial estimate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:bashbugSomething isn't workingdata-lossduplicateThis issue or pull request already existshas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsstaleIssue is inactive

    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