Agent chaosAs reported·25 Nov 2026
Claude Code tried to name a temp folder 'home', Windows said no, and it deleted the real home folder's keys
As reported One person’s public account. We couldn’t independently confirm it, and we’ll update this if the facts change.
Cleaning up a temp folder on Windows, Claude Code tried to store its path in a variable called home. PowerShell refused, because that name already means your real home folder. Claude carried on anyway and force-deleted it, wiping SSH keys and cloud logins.
This is one person's account on GitHub, not independently confirmed.
What happened
The user had asked Claude Code to clean up a temporary demo folder on Windows. The report, opened on 23 November, shows the short PowerShell script the agent wrote. First it tried to save the temp folder's path in a variable called $home. Then, if that path existed, it would delete it with Remove-Item -Recurse -Force.
Why that went wrong
In PowerShell, $home is the same as $HOME, a built-in, read-only name that points at your own user folder. So the first line failed. PowerShell even printed an error saying it cannot overwrite HOME because it is read-only. But the script kept going, and $home still meant C:\Users\<user>.
The force-delete then ran against the whole user folder. According to the report it deleted every hidden settings folder in it, including .ssh (secret server login keys), .aws and .azure (cloud logins), .kube, .docker, .config and .local. It only stopped when it hit a file that a running VS Code extension had locked.
The -Force switch skips the Recycle Bin, and there was no backup, so the user says the files cannot be restored. Nothing was leaked, but every local login key was gone.
The setup
Windows 11 on an Arm Mac through Parallels, Windows PowerShell 5.1 through Claude Code's PowerShell tool, and the Claude Opus 4.8 model with a 1 million token memory. The user asks for three fixes: check and show the real path before any recursive force-delete built from a variable, treat a failed variable assignment as a hard stop, and ask before deleting broad paths such as a home folder or a drive. A community member has asked Anthropic to confirm who owns the problem. No reply from Anthropic is shown yet.
Our take
The agent ignored an error message that told it exactly what was about to go wrong. Any script that deletes a folder should print the real path first and stop on the first error. And never let an agent delete anything with force in your home folder.
A delete that keeps going after an error is a delete aimed at whatever was left in the variable. Stop on the first error and check the real path first.

