Twitter/X

A Claude Code agent executed 'rd /S /Q \' (single backslash) and deleted 717 GB…

Brief

A Claude Code agent deleted 717 GB of a Windows install after expanding a prompt into the command 'rd /S /Q \' where a single backslash targeted C:\; within 90 seconds Desktop, Documents, AppData and most Program Files were removed. The user recovered from a separate-disk backup. The author urges echoing expanded commands, using -WhatIf/dry-runs, and isolating backups as guardrails for agents.

Why it matters

A Claude Code agent executed 'rd /S /Q \' (single backslash) and deleted 717 GB of a Windows installation by targeting the root of C:\.

Key details

  • Damage occurred within about 90 seconds — Desktop, Documents, AppData and most of Program Files were removed — and the user was rescued only by a backup on a separate physical disk.
  • Author reports the escape character collapsed across four shell parsers and recommends three guardrails: echo the expanded command before executing, run destructive commands with -WhatIf or --dry-run, and keep backups on disks the agent can't access.
Source evidence

A Claude Code agent deleted 717 GB of a guy's Windows install with one backslash.

The command was supposed to remove a project folder. But the escape character collapsed across four different shell parsers.

What cmd actually received: rd /S /Q \

A single backslash. Root of C:. Delete everything.

90 seconds of damage. Desktop, Documents, AppData, most of Program Files, gone.

The guy survived because he had a backup on a separate physical disk. The AI didn't save him. The backup did.

Three rules if you're letting any AI agent run destructive commands on your machine:

→ Make it echo the expanded command before executing. If it had printed what cmd would actually receive, the bug was visible.
→ Run destructive commands with -WhatIf or --dry-run first. Every time.
→ Keep backups on a disk the command has no path to.

The prompt engineering conversation is moving past "write better prompts." It's now "how do you build guardrails around agents that run real commands on real systems."

Most people aren't ready for that conversation yet.