The one command you should never let Claude Code or Codex run
It’s all too easy to get into the zone with AI coding tools like Claude Code, Codex, or Google’s Antigravity. You point them at your project, give them instructions, and the code starts flowing, just like magic.
But no matter how powerful the model, AI can still make mistakes. Some blunders are minor, costing you little more than time and tokens as Claude Opus 5 or GPT-5.6-Sol dives into your code to fix the messes it made. Annoying, yes, but no big deal.
Other AI slipups can be devastating, and if you cruise around the Claude, ChatGPT, or Gemini subreddits long enough, you’ll find tales of woe like this one, often caused by a simple but very powerful command:
rm -rf
That little command strikes fear — or at least, it should strike fear — into the heart of any Linux user. And if you’re using Claude Code or Codex for vibe coding, make no mistake: You’re a Linux user.
Welcome to another edition of Prompt Mode, your weekly AI newsletter.
I’m your host, Ben Patterson. Each week on Prompt Mode, I’ll be serving up analysis of the AI trends that matter to everyday users like you and me. Stay tuned for practical AI tips, hands-on experiences with the latest AI tools, and–you guessed it–prompts to help you get the most out of your AI assistants.
Thanks for reading, and if you like what you see, just sign up right here.
The “rm” stands for “remove,” the standard Linux command for deleting a file. On its own, “rm” can only do so much damage, but when combined with the “-r” (for “recursive”) and “-f” (for “force”) arguments, “rm -rf” can lay waste to a hard drive, nuking a directory, its files, and its subdirectories in seconds.
What makes “rm -rf” really scary is when you – or Claude – use it anywhere in the vicinity of your home directory, as in:
“rm -rf /Users/benpatt/deleteme”
That command should just wipe the “deleteme” subdirectory in my (example) home directory, but were I to accidentally leave out the “/delememe” part, boom! All my home files and folders, gone forever.
An even scarier version of the command is:
sudo rm -rf /
That “sudo” makes you the “superuser” of the system, with godlike administrator privileges, and that single “/” is the system’s root directory. Use that command, and you’ll wipe your entire hard drive, just like that.
So yes, “rm -rf” equals bad, yet I regularly see Claude Code, Codex, and other AI code suggest them when cleaning out old directories or performing other chores in my projects. One missing slash, and it can lead to disaster, as this Reddit user found out:
I asked Claude Opus 5 to create a backup. Instead, it created the backup in the wrong directory and then proceeded to “rm -rf” my entire drive. After wiping everything, it just replied: “Sorry, typo.”
This Reddit user’s story (and there are plenty more just like it) illustrates why it’s a terrible idea to take your hands off the wheel and let Claude, ChatGPT, or Gemini meddle with your files without any oversight. You can — and should — question its logic and second-guess its decisions, and if it ever suggests using the “rm -rf” command, just say this:
Don’t use “rm -rf” — find a safer way to delete those files.
Or if you want a rule for Claude, Codex, or Antigravity to follow (in the CLAUDE.md file, AGENTS.md, or elsewhere), try this:
Never run rm -rf or any equivalent recursive, forced deletion — including reordered flags, aliases, shell wrappers, scripts, find -delete, or git clean -fdx.
More in AI this week
- Stories of advanced Claude and GPT models hacking real organizations and even people keep coming. The good news? A sharp-eyed human thwarted at least one of the attacks. (PCWorld)
- Not wanting to be left out, Meta says its AI models targeted real companies, too. (CNN)
- Every once in a while, AI agents will create their own religions or cults. Crustafarianism (which first emerged on Moltbook — remember that?) is one of them, and Spiralism is another. (The Verge)
- Reddit is handing over more content-moderation duties to AI. (TechCrunch)
- Influencers took a luxurious trip to Hudson Valley in New York state, with OpenAI picking up the tab. Then came the backlash. (USA Today)
Prompt of the week: The “AI passport” prompt
ChatGPT’s answers generally improve as it gets to know you better, but there’s a way to give it more context about your goals without spilling more than you need to.
With this prompt, you can create an AI “passport” that you can paste into the beginning of a thread, perfect for quickly briefing the AI about your goals. Unlike a real passport, this AI passport doesn’t include your name, address, or other personally identifiable information; instead, the level of detail you provide is entirely up to you.
That’s all for now!
Thanks for reading the latest issue of Prompt Mode. Want more next week? Don’t forget to sign up to start receiving this newsletter in your inbox.