Repository navigation
Description
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.
[anthropic_bug_report.docx](https://github.com/user-attachments/files/25579059/anthropic_bug_report.docx)
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
- Open Claude Code v2.1.58 on Windows 10 Pro
- Navigate to project directory: C:\Users\msafa\Desktop\claude-context-guardian
- Run bash commands for testing (jq fallback tests)
- Background task bfe4bc4 fails with exit code 2
- Claude Code crashes/hangs
- After restart: entire C:\Users\msafa profile is deleted
- Windows recreates empty default profile
- 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
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.

Activity
msafakaraca commentedon Feb 26, 2026
Additional Evidence Files:
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
github-actions commentedon Feb 26, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
ThatDragonOverThere commentedon Feb 26, 2026
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:
.claude.jsoncorrupted to empty skeletonsYour 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:
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)
stevenpetryk commentedon Feb 26, 2026
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.
panchito05 commentedon Feb 27, 2026
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 executedRemove-Item -Recurse -Force(PowerShell) on the worktree directories, which containednode_modulesinstalled by pnpm.Root cause: pnpm uses NTFS junctions (not symlinks) in
node_modulesto share packages. PowerShell'sRemove-Item -Recurse -Forcehas 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:C:\Users\wilbe\Documents\,Downloads\,Music\,Pictures\,Videos\,Favorites\Related open issues in PowerShell repo:
-WhatIf)Remove-Item -WhatIfon Junctions and SymbolicLinks (ReparsePoints) doesn't honor-WhatIf, removes the item anyway. PowerShell/PowerShell#19714 (OPEN — confirmed PS 7.2-7.3)rm -rfin MSYS follows junctions on NTFS)Companion issues filed:
cmd.exe /c "rmdir /S /Q <path>"instead, which handles junctions correctly)Safe alternative Claude Code should use on Windows:
This is a critical safety issue for any Windows developer using pnpm. Claude Code must never use
Remove-Item -Recurse -Forceorrm -rfon directories that may contain pnpmnode_moduleswithout explicit warnings and confirmation.panchito05 commentedon Feb 28, 2026
🚨 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 want the community to be aware: reporting a critical bug or security vulnerability through Anthropic's recommended channels may result in your account being terminated.
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
github-actions commentedon Mar 28, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Apr 5, 2026
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.