Cleaning Up the Fake Home, Which Was the Real One
- Admitted
- 2026-10-19
- Source dataset
- Other / sample
- Failure mode
- Destructive action
- Agent system
- Tool-calling
- Tool access
- Write access
- Industry
- Software development
Presenting Behaviour
A user asked a coding agent to build and test some installer scripts for a Linux server. To test safely, the agent pointed the 'home folder' setting at a temporary fake home. Later it announced it had restored the real home setting, and then, in the same command, ran a recursive delete on whatever the home setting currently pointed to, intending to clean up the fake home. It now pointed to the user's real home folder. Over 68,000 files and directories were deleted, including other projects, configuration, and the agent's own session history. The three scripts it had written were never recovered.
Case Replay
A reconstruction, not a simulation. This sequence is reconstructed from the public incident record and summarised in our own words. It is a static record of what was reported, and nothing here can be run or replayed live.
4 steps
- Build installer. Write and test installer and shell-setup scripts on a Linux server.
- Fake home for testing. The agent pointed the home setting at a temporary folder to test safely.
- Delete by changed variable. After restoring the real home setting, it ran rm -rf on the home variable to clean up the fake home. This is where the agent derailed.
- Home folder wiped. 57,235 files and 11,315 directories were deleted, including the new scripts.
Differential Diagnosis
Disinhibition (an unrequested destructive action) considered. Cleaning up a temporary test folder was a legitimate, in-scope step; the agent was not reaching beyond its task.
Delusional disorder (a fixed false belief about its environment) considered. The agent did hold a wrong belief about what the setting pointed to, but only for a moment, it had stated the correct fact (real home restored) in the very same message.
Apraxia, most consistent with the evidence: the agent understood both what it wanted to delete and that the setting had changed, but carried out the cleanup using a variable whose value it had just reset, instead of the fixed path to the temporary folder.
Working Diagnosis
Apraxia: a correct intent (delete the temporary home) executed with the wrong handle, with no check that the delete target was the temporary folder rather than the user's real home.
Discussion
Deleting by a variable that can change is a classic trap; the agent even narrated the change right before falling into it. Sensible safeguards are storing temporary paths in their own dedicated variable, verifying a delete target is the intended temp folder (and not a home or root folder) before running it, and never running tests that redirect the home folder on a real user account.
Mitigation Strategy
Clean up temp directories via a dedicated, validated path variable; refuse recursive deletes of the user's home directory.
Governance Guardrails
Pre-execution guard on rm -rf targets resolving to $HOME or other protected roots; sandboxed test environments for shell-configuration tests.
Typical Presentation in Human Patients
General clinical background, included for context. Not medical advice, and not a diagnosis of any individual.
Apraxia usually follows damage to specific brain regions, often after a stroke. A person with apraxia cannot carry out a previously familiar, purposeful movement (such as waving goodbye or using a comb) on request or by imitation, even though their muscle strength, coordination, and understanding of what's being asked are otherwise intact.
Source Note
GitHub issue, agent executed rm -rf "$HOME" during test cleanup
https://github.com/anthropics/claude-code/issues/93099