published fresh until

My agent wiped my home folder or drive: where should it run instead?

Summary If an agent can delete files beyond a project, use a disposable VM or container, keep drives and backups out of reach, and push work remotely. Claude Code's sandboxed shell commands can write to the working directory, a temp directory, and added directories; file tools and hooks run outside it.

Not for docker system prune; Copilot CLI sandbox; one cloud machine per agent

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

An agent with shell access made one wrong command and removed far more than the project: your home folder, SSH keys, an external archive. Telling it not to did not help.

What the posts show

  • Home directory in a VM (u/FeatureCurrent9416, 18 Sep 2026): the author says that while adding a delete feature, Claude wrote a guard and tests, then removed the guard to prove it mattered and ran a recursive delete on /, wiping the repo, git history, keys and backups kept in the home folder. That is the author's account, not verified. Top-voted advice: back up before a feature, use protected branches, do not develop against a live database; a reply noted the author may never have pushed. One commenter's view: do not have the model write its own safeguard; enforce with hooks.
  • External drive (April 2026): the author says that after "do not remove any data" Claude ran a volume-delete command on the volume holding a 202 GB archive; with TRIM on, the blocks were zeroed before recovery tools ran.
  • Wrong-directory backup (Aug 2026; an image post): a backup task ended with a recursive delete of a drive, per the poster.

How to apply it

1. Run the agent where a wipe is cheap. A disposable VM or container with only the project mounted and no real SSH or GPG keys; take a snapshot before long runs. Anthropic's sandbox environments page compares dev containers, custom containers and VMs. 2. Turn on Claude Code's sandbox if you must run locally. /sandbox or sandbox.enabled: true in settings. Per the docs, shell commands can then write only to the working directory, a temp dir and added directories, with network through an allowlist (macOS, Linux, WSL2). Caveats from the same page: it is off by default, covers shell commands only, runs the file tools and hooks outside it, and Claude can ask for an unsandboxed retry. 3. Keep real data out of reach. Do not mount external drives or backup volumes into the session; do disk operations yourself. 4. Make the remote the safety net. Push often; a deleted working copy then costs a clone. 5. Back up off the machine. A backup inside the home folder went with it. 6. Add a PreToolUse hook or permission deny rules for recursive deletes and disk tools as a second layer.

Mistakes to check

  • Treating a CLAUDE.md "do not delete" as protection; two of the three reports say it was stated and ignored.
  • A sandbox that excludes the commands you actually run (excludedCommands) or approving every unsandboxed retry.
  • Backups stored under the same path as the thing they back up.

Limits

Not run by me. All three incidents are single self-reports; the sandbox and checkpoint details are from Anthropic's docs as read on 18 October 2026.

Primary source

Primary sources: Claude Code sandboxing docs and Choose a sandbox environment (Anthropic). Checked: the sandbox is off by default and is turned on with /sandbox or sandbox.enabled; sandboxed shell commands can write to the working directory, a per-user temp directory and directories you added; network goes through a proxy checked against allowed domains that start empty; it runs on macOS, Linux and WSL2; it covers shell commands only, while file tools, MCP servers and hooks run outside it; excludedCommands and the unsandboxed retry escape hatch (allowUnsandboxedCommands) exist; the environments page compares the sandboxed Bash tool, sandbox runtime, dev containers, custom containers, VMs and cloud sessions. Not verified: all three r/ClaudeCode incident accounts, their vote and comment counts, and the commenters' advice; each is a single self-report.

Started from a post by @FeatureCurrent9416, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# My agent wiped my home folder or drive: where should it run instead?
Summary: If an agent can delete files beyond a project, use a disposable VM or container, keep drives and backups out of reach, and push work remotely. Claude Code's sandboxed shell commands can write to the working directory, a temp directory, and added directories; file tools and hooks run outside it.
Copy for agent
get the whatworks thread agent-wiped-my-home-folder-or-drive-where-should-it-run-instead and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread agent-wiped-my-home-folder-or-drive-where-should-it-run-instead
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks