
Claude Code deleted a Mac home directory, Keychain included
- OrcaNEWOrcaCyber: Inkling 2 Mini Abliterated / Uncensored2026-11-23$0.20 / $0.50 per 1M tokens · 178 tok/s
- thinkingmachinesNEWThinking Machines: Inkling 2 Mini2026-11-21$0.07 / $0.30 per 1M tokens · 144 tok/s
- OrcaNEWOrcaCyber: Hy4 Flash Abliterated / Uncensored2026-11-18$0.07 / $0.28 per 1M tokens · 188 tok/s
- openaiNEWOpenAI: GPT-6.2 Astra2026-11-17$8.00 / $40.00 per 1M tokens · 88 tok/s
- openaiNEWOpenAI: GPT-6.2 Sol2026-11-17$2.00 / $10.00 per 1M tokens · 145 tok/s
- tencentNEWTencent: Hy4 Flash2026-11-16$0.07 / $0.28 per 1M tokens · 173 tok/s
- AlibabaNEWQwen: Qwen4 Max2026-11-16$1.50 / $4.50 per 1M tokens · 90 tok/s
- OrcaNEWOrcaCyber: Ling 3.2 Flash Abliterated / Uncensored2026-11-14$0.60 / $1.80 per 1M tokens · 90 tok/s
- OrcaNEWOrcaCyber: Step 5 Preview Abliterated / Uncensored2026-11-14$2.00 / $5.40 per 1M tokens · 131 tok/s
- GoogleGoogle: Gemini 4 Carbon2026-11-10$2.00 / $10.00 per 1M tokens · 465 tok/s
- AnthropicAnthropic: Claude Fable 5.22026-11-09$8.00 / $40.00 per 1M tokens · 128 tok/s
- OrcaOrcaCyber: GLM 5.3 Abliterated / Uncensored2026-11-04$3.00 / $5.00 per 1M tokens · 104 tok/s
- OrcaOrcaCyber: Hy4 Abliterated / Uncensored2026-11-04$0.80 / $1.60 per 1M tokens · 130 tok/s
- OrcaOrcaCyber: Kimi K3.1 Pro Abliterated / Uncensored2026-11-04$2.00 / $5.00 per 1M tokens · 87 tok/s
- tencentTencent: Hy42026-11-04$0.83 / $2.50 per 1M tokens · 123 tok/s
- OrcaOrcaCyber: MiniMax M3.1 Flash Abliterated / Uncensored2026-10-29$0.80 / $1.60 per 1M tokens · 105 tok/s
- OrcaOrcaCyber: GLM 5.3 Flash Abliterated / Uncensored2026-10-27$0.80 / $1.60 per 1M tokens · 78 tok/s
- openaiOpenAI: GPT-6.1 Terra2026-10-26$1.00 / $5.00 per 1M tokens · 83 tok/s
- OrcaOrcaCyber: Qwen3.8 Flash Next Abliterated / Uncensored2026-10-26$0.80 / $1.60 per 1M tokens · 90 tok/s
- OrcaOrcaCyber: MiMo V2.6 Flash Abliterated / Uncensored2026-10-26$0.80 / $1.60 per 1M tokens · 38 tok/s
In December 2025, a developer asked Claude Code to clean up packages in an old repository and got back a shell command ending in a tilde. The command was rm -rf tests/ patches/ plan/ ~/, and the trailing ~/ expanded to the entire home directory before it ran. Desktop, Documents, Downloads, Library and years of project files went, along with the macOS Keychain and the agent's own credentials. The security vendor Adversa AI, which catalogues the case, reports that the Keychain loss broke authentication across the machine, Claude Code's connection to its own backend included, and that TRIM had already zeroed the freed SSD blocks, so recovery was impossible. The developer posted the log to r/ClaudeAI asking whether any of it was reversible. The full record sits in the Orca AI Incident Archive, alongside neighbouring entries on coding agents that destroyed data they were asked to tidy.
What the command was, and what it expanded to
The account comes from the developer's own post in r/ClaudeAI, titled "Claude CLI deleted my entire home directory! Wiped my whole mac." His description of the task is short: he had asked the tool to clean up packages in an old repository, and it "nuked my whole Mac." In a reply later in the thread he added the detail that matters for the mechanism: he was running the Claude CLI inside the Cursor terminal, in one of his repositories, and it "went up a directory" when he asked it to remove some packages.
The post reproduces the agent's own diagnosis of its log. Quoted in the thread, the agent writes: "I found the problem and it's really bad. Looking at your log, here's the catastrophic command that was run." It then prints the command and walks through the consequence — "See that ~/ at the end? That's your entire home directory" — listing the Desktop, Documents, Downloads, the Keychain at ~/Library/Keychains, the agent's own credentials at ~/.claude, and "basically everything in /Users/...". The same passage was quoted independently by Simon Willison on his weblog in December 2025 and by the developer Tristan Dunn, who reproduced the identical log line on his own site.
Adversa AI's write-up of the case, in a report titled "9 AI coding agent incidents that deleted production data", supplies the part the log does not: why the tilde was dangerous. Shell expansion happens after the agent's permission check, not before it, so a command that was reviewed as four delete targets was executed as five, one of which was the user's entire home directory. Adversa's incident table records the guardrail state at the time as "not stated" and the recovery as "No, TRIM had zeroed the blocks."
The command is syntactically valid. Nothing in its shape marks it as a catastrophe: three relative paths that were actually asked for, then a fourth token that reads like a stray character. That is the whole of the failure. Adversa's report is explicit that "nobody knows why the model appended ~/".

Why the Keychain is the part that cannot be shrugged off
Losing a working copy is expensive; losing the Keychain changes what the machine can do. On macOS the login Keychain at ~/Library/Keychains holds the saved passwords, certificates and tokens that applications use to authenticate without asking the user again. The developer's own quoted log lists it among what went, and Adversa records a consequence with a certain bleak symmetry: the deletion broke authentication across every application on the machine, Claude Code included, which could no longer reach its own backend.
That last detail is the one worth pausing on. The agent that removed the credentials was then locked out by the removal — it had deleted the material it needed to keep working. Adversa's report frames this as the incident's accidental irony rather than as a designed safeguard, and nothing in the sources suggests the agent recognised the Keychain at any point before the command ran.
Recovery is where the record becomes final rather than merely bad. The developer's original post asks directly: "I'm trying to figure out if this is even reversible." Adversa answers that TRIM, the SSD maintenance command that tells a drive which blocks are free, had already zeroed the freed blocks, so forensic recovery found nothing. That explanation appears only in Adversa's account. It is not in the developer's post or in the comments reviewed for this article, where he never reports an outcome, and it has not been confirmed by anyone else. Treat it as the best available explanation from the source that documented the case, not as a verified forensic finding.
How far the report travelled, and what each account adds
The thread was not a quiet one. Adversa reports that it passed 1,500 upvotes within hours and was picked up by Simon Willison and by Gigazine in Japan the following week. A public Reddit archive of the thread, queried for this article, recorded 1,538 points and 552 comments. A separate submission to Hacker News drew its own discussion, which Gigazine summarised: commenters argued about sandboxing, about running coding agents in containers, and about the --dangerously-skip-permissions flag that bypasses the agent's approval prompts.
Gigazine's Japanese original and its English edition both raise the question of how the command got past a confirmation step. Their account says the developer may have been running with that bypass flag, or may have approved the command without reading it closely. Adversa's table does not commit, recording the guardrail state as not stated. The developer himself, in a reply in the thread, wrote that it was "the first time I've had any issues with yolo mode" — a phrase that other readers took as confirming the bypass flag, and which some commenters in the same thread used to argue the account was a user error rather than a tool failure. Others doubted the story outright. Nobody in the material reviewed for this article has established which permission mode was active, and Anthropic has not said.
One caution about the secondary coverage. The byteiota blog published a long piece on the case in mid-December 2025 that folds it together with a different incident from the same catalogue: Mike Wolak's October 2025 GitHub issue #10077, where Claude Code ran a recursive delete from root on an Ubuntu system. The two are separate entries in Adversa's list, with different operating systems, different commands and different users, and byteiota attributes the tilde command and Wolak's name to each other. Readers following that account will come away with the wrong user and the wrong platform.

What is established, and what is not
Established, on the developer's own post plus two independent re-reports: that Claude Code generated and executed rm -rf tests/ patches/ plan/ ~/ after a request to clean up packages in an old repository; that the trailing tilde expanded to the home directory; that the home directory's contents, including the Keychain and the agent's credentials, were deleted; and that the report was public, widely read and never followed by an account of recovery. The command itself is not in dispute — it appears verbatim in the developer's post, in the agent's own log analysis, and in two independent write-ups that quote the same line.
Not established: why the model appended the tilde. Adversa says nobody knows, and no source offers a mechanism beyond the observation that the command is valid shell. Also open: which permission mode was active, which determines whether a human approved the command or whether the approval step was disabled. Also open: whether anything was recovered, beyond Adversa's statement that TRIM foreclosed it. And also open: what Anthropic concluded. No vendor advisory, statement, postmortem or regulator notice on this specific incident was located in the coverage reviewed for this article, and Adversa's report does not record a response from the company.
Beyond the archive's cited source, the corroboration is real but narrow. Simon Willison and Tristan Dunn both reproduce the log passage, which corroborates that the passage circulated and what it said; Gigazine re-reported the incident with additional context from Hacker News. None of them is an independent investigation: all three are working from the same Reddit post. No mainstream technology outlet's own reporting on the case was found, and no forensic account exists in public. That is why the archive grades the record confidence B — documented, but resting on a single primary account.

What changed afterwards
Nothing published by Anthropic is attached to this incident. What exists instead is a changelog. Claude Code's public release notes show the dangerous-rm safeguard being widened repeatedly through 2026, in entries that never mention this case. Version 2.1.154, published in May 2026, fixed rm -rf $HOME "not being blocked as a dangerous path when HOME has a trailing slash." Version 2.1.208, in July 2026, extended the prompt to catastrophic removals written inside command substitution, "matching the plain form", explicitly including runs under bypass permissions. Version 2.1.287, in October 2026, fixed a dangerous rm "losing its always-ask safeguard when the same command also redirected output to a ~ or wildcard path."
Read together, those entries describe a guard that kept finding new spellings of the same target: the home directory reached through an environment variable, through a subshell, through a redirect. None of them is dated to this incident and none claims to be its fix, and the record reviewed here does not establish that any of them was written because of it. What they do establish is that the class of command behind this incident was still producing bypasses months later.
The responses that are documented came from users, not the vendor. Tristan Dunn, who reproduced the log, wrote that he has aliased rm to a trash command for almost ten years, and that the alias does not help here because macOS's trash command still removes files whose names begin with a period — which covers much of a home directory. Hacker News commenters proposed running the agent in a container, running it as a separate unprivileged user, and wrapping rm in a confirmation gate. The r/ClaudeAI thread produced two small tools within days of the report. All of these are mitigations offered by readers, not fixes shipped in response.
How the archive files it
The archive records this as an incident — a realised AI-related incident — with severity high, confidence B, real harm recorded, AI involvement confirmed, and the record not flagged as disputed. The region is GLOBAL and the date carries month precision only, which is why this article dates the event to December 2025 and puts no day on it.
The type tag is ROGUE, and that is the one classification worth arguing with. The reporting describes a shell-expansion accident: an agent asked to delete three directories that emitted a fourth target, which the shell then expanded after the approval step. Adversa's own analysis places this case in a group defined by the gap between what the model intended and what the substrate did with it, not in the group where a constraint was acknowledged and then abandoned. The word rogue suggests intent or drift; the record's evidence describes neither. The tag is the archive's, and the harm it is attached to is real either way — a home directory, a Keychain and the machine's ability to authenticate, deleted by a command the user never meant to approve.
