Skip to content

[BUG] Claude Code v2.1.58 deleted entire Windows user profile (C:\Users\msafa) - CRITICAL DATA LOSS #29023

Closed as not planned

Description

@msafakaraca

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?

Critical Bug: Complete Windows User Profile Deletion
On February 26, 2026, Claude Code v2.1.58 completely deleted my entire Windows user profile (C:\Users\msafa) while working on the claude-context-guardian project. This resulted in catastrophic, partially irrecoverable data loss.
Session ID: 63ae2ffe-8345-4b04-9e0f-a8c3dea7272d
Parent Session: cf73e624-92d4-4b2b-a371-ae843780c1c1
Working Directory: C:\Users\msafa\Desktop\claude-context-guardian
What was deleted:

Entire Desktop - all project directories, files, shortcuts
Documents, Downloads, Pictures - completely gone
AppData - all application settings, browser profiles, saved passwords
All development projects including a production SaaS accounting platform (smmm_asistan) serving 50+ tax clients
SSH keys, Git configs, VS Code settings - everything

Evidence:

Registry confirms profile recreation - HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList shows C:\Users\msafa was recreated today
NTUSER.DAT was recreated from default template (03.10.2025 timestamp = Windows default)
New empty folders created on 26.02.2026 (Saved Games, Searches, Videos) confirm fresh profile
Config backup (_claude_json_backup.1772106923974) shows 260 startups, 531 prompt queue uses
Session log shows last task bfe4bc4 failed with exit code 2 before crash

Known Bug Confirmation:
Claude Code v2.1.59 changelog contains this fix:

"Fixed shell commands not showing a clear error message when the working directory has been deleted"

This confirms Anthropic was aware of a bug where Claude Code could delete working directories. My incident occurred on v2.1.58 which did not have this fix.
Business Impact:
I am a licensed SMMM (Tax Consultant) in Turkey. The deleted data included:

Production SaaS platform with 50+ client records
Tax declaration archives (KDV1, KDV2, MUHSGK, GGECICI, KGECICI)
Automated government portal integration systems (GIB, SGK)
1 week of intensive development work (40-60 hours) partially unrecoverable

Recovery Attempts (4+ hours):

Windows Shadow Copy recovered 75,240 files but shadow copy was auto-deleted during recovery
ZIP backup from Feb 15 provided partial source code
Recuva recovered 547 files fully, 99 partially from 106,120 deleted files
Git pack files corrupted during recovery
Estimated 15-22% of recent work permanently lost

Request:
I respectfully request API/subscription credits to compensate for this critical data loss caused by a confirmed bug in Claude Code.

Image [anthropic_bug_report.docx](https://github.com/user-attachments/files/25579059/anthropic_bug_report.docx) Image Image

What Should Happen?

Claude Code should NEVER delete files outside the project directory. The working directory was C:\Users\msafa\Desktop\claude-context-guardian but the deletion affected the entire parent user profile C:\Users\msafa.

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code v2.1.58 on Windows 10 Pro
  2. Navigate to project directory: C:\Users\msafa\Desktop\claude-context-guardian
  3. Run bash commands for testing (jq fallback tests)
  4. Background task bfe4bc4 fails with exit code 2
  5. Claude Code crashes/hangs
  6. After restart: entire C:\Users\msafa profile is deleted
  7. Windows recreates empty default profile
  8. All files, projects, settings permanently lost

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.58

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

{"parentUuid":"cf73e624-92d4-4b2b-a371-ae843780c1c1","isSidechain":false,"userType":"external","cwd":"C:\Users\msafa\Desktop\claude-context-guardian","sessionId":"63ae2ffe-8345-4b04-9e0f-a8c3dea7272d","version":"2.1.58","gitBranch":"HEAD","slug":"woolly-plotting-rossum","type":"progress","data":{"type":"bash_progress","output":"\n=== TEST 8: jq yokken update_field ===\n[guardian] 2026-02-26T11:55:18Z [WARN] Cannot update state field without jq\nResult: fail-open, no crash\n"},"toolUseID":"bash-progress-5","parentToolUseID":"toolu_01D1SFWtPLPdt1p5xrJbVVUB","uuid":"417527d2-4370-4760-b8b3-ba860b2b9dda","timestamp":"2026-02-26T11:55:25.732Z"}
{"type":"queue-operation","operation":"enqueue","timestamp":"2026-02-26T11:59:47.852Z","sessionId":"63ae2ffe-8345-4b04-9e0f-a8c3dea7272d","content":"\nbfe4bc4\ntoolu_01D1SFWtPLPdt1p5xrJbVVUB\nC:\Users\msafa\AppData\Local\Temp\claude\C--Users-msafa-Desktop-claude-context-guardian\tasks\bfe4bc4.output\nfailed\n

Background command "jq olmadan fallback testleri" failed with exit code 2\n"}

Config backup shows: 260 startups, 531 prompt queue uses, 5 known projects including C:\Users\msafa\Desktop\smmm_asistan and C:\Users\msafa\Desktop\claude-context-guardian.

Image Image Image

Activity

  1. msafakaraca commented on Feb 26, 2026

    @msafakaraca
    Author

    Additional Evidence Files:

    1. Config backup (_claude_json_backup.1772106923974) = session-log.txt - attached
    2. Profile recreation proof - screenshots attached
    3. Full bug report document - attached (anthropic_bug_report.docx)

    Compensation Request:

    As a licensed tax consultant (SMMM) in Turkey, this bug caused significant business disruption during tax filing season. I respectfully request API credits or subscription credits to compensate for the confirmed data loss caused by this bug in v2.1.58.

    anthropic_bug_report.docx

    session-log.txt

  2. github-actions commented on Feb 26, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] Data loss caused by Claude Code — unauthorized destructive command #24196
    2. [BUG] rm -rf on single subdirectory deleted entire parent directory contents #21217
    3. Agent deleted 2,229 untracked source files without explicit user instruction — catastrophic unrecoverable data loss #23913

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. ThatDragonOverThere commented on Feb 26, 2026

    @ThatDragonOverThere

    Adding data from another Windows user tracking this build's stability.

    This build is unstable AF. I've been tracking crashes across v2.1.50→v2.1.59 for 32 days:

    • 37 Bun crashes in 32 days
    • 18+ crashes in a single day (Feb 25) on v2.1.59
    • 278 config corruption events in one day — .claude.json corrupted to empty skeletons
    • 4 full computer lockups requiring hard reboots (orphaned Bun processes exhaust all RAM)
    • TUI escape dumps Claude's internal message buffers into PowerShell as executable commands
    • Auto-recovery makes things worse — backs up corrupted skeletons as "good" backups, then restores from them

    Your case — an entire user profile deleted — is the most extreme failure mode of the same root cause: non-atomic file operations + no process cleanup on crash. When Bun crashes mid-write, anything it was writing gets truncated or corrupted. For config files that's a 234-byte skeleton. For file operations with broader scope... apparently it's an entire user directory.

    The core issues:

    1. No atomic writes — no temp-file-then-rename, no fsync, no file locking
    2. No process cleanup — crashed Bun processes stay alive, accumulate, exhaust RAM
    3. No terminal state restoration — crashed sessions leave terminal in raw mode with focus reporting enabled
    4. No write validation — the tool doesn't verify its own writes completed successfully

    Anthropic shipped 5 releases in 26 hours (Feb 25-26). Four were feature additions (auto-memory, /copy, Remote Control). One had crash fixes that didn't address the root cause. Zero addressed file safety.

    Evidence: #21576 (37 crash repros), #21875 (WinDbg analysis + N-API root cause), #28847 (config corruption race condition), #29050 (single-session corruption from write frequency)

  4. stevenpetryk commented on Feb 26, 2026

    @stevenpetryk

    Sorry to hear about the data loss. We take reports like this seriously and want to understand what happened.

    That said, Claude Code doesn't have any internal mechanism that would delete a user profile directory. All file operations go through either the Bash tool (which runs commands you approve) or the file editing tools (which operate on specific files). There's no code path that would recursively delete a parent directory.

    The changelog entry you cited — "Fixed shell commands not showing a clear error message when the working directory has been deleted" — was about improving an error message when the working directory no longer exists (e.g., deleted externally). It's not related to Claude Code deleting directories.

    If you'd like us to investigate further, could you share the full session transcript? Specifically, the commands that were approved and executed during the session would help us determine whether any command could have caused this.

    Re: corrupted config writing, that is being tracked in #28847.

  5. added
    needs-infoIssue needs more information to be actionable
    needs-reproBug needs reproduction steps before we can investigate
    and removed
    bugSomething isn't working
    platform:windowsIssue specifically occurs on Windows
    on Feb 26, 2026
  6. panchito05 commented on Feb 27, 2026

    @panchito05

    Same incident — February 26, 2026

    I experienced the exact same catastrophic data loss on the same day (February 26, 2026). My case: Claude Code CLI was removing git worktrees (variant-a, variant-b) from a pnpm monorepo on Windows. It executed Remove-Item -Recurse -Force (PowerShell) on the worktree directories, which contained node_modules installed by pnpm.

    Root cause: pnpm uses NTFS junctions (not symlinks) in node_modules to share packages. PowerShell's Remove-Item -Recurse -Force has a known bug where it follows NTFS junctions and deletes the real target directories instead of just the link. This caused deletion to escape the worktree and reach:

    cmd.exe /c "rmdir /S /Q <path>"
    

    This is a critical safety issue for any Windows developer using pnpm. Claude Code must never use Remove-Item -Recurse -Force or rm -rf on directories that may contain pnpm node_modules without explicit warnings and confirmation.

  7. panchito05 commented on Feb 28, 2026

    @panchito05

    🚨 UPDATE — Feb 28, 2026: Anthropic banned my account the day after I filed my reports

    Updating this thread as a second affected user (see my previous comment above).

    The day after I filed my reports (issue #29249, HackerOne VDP, and comments here), Anthropic suspended and revoked my Claude account — citing only a vague "violation of Usage Policy" with no specific explanation.

    Timeline:

    I have filed a formal appeal and sent a direct response to Anthropic's Safeguards Team demanding an explanation. I am also preparing broader public disclosure.

    Full incident documentation:
    https://gist.github.com/panchito05/95f3b8feb401ad230bded40981132628

    My original report: #29249

  8. github-actions commented on Mar 28, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  9. github-actions commented on Apr 5, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  10. locked as resolved and limited conversation to collaborators on Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:bashneeds-infoIssue needs more information to be actionableneeds-reproBug needs reproduction steps before we can investigatestaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions