DEV Community

Honey Kiran
Honey Kiran

Posted on Originally published at honeykiran.substack.com on

One Missing Quote Mark. The Agent Deleted ~/Library.

One Missing Quote Mark. The Agent Deleted ~/Library.

A poster on r/ClaudeCode reports the cleanest horror story of the month: an agent ran a cleanup command built on xargs, a path with a space in it split into two arguments, and the delete landed on ~/Library — the folder macOS keeps your app data, mail and keychains in. (One poster's report, told here as they told it; the mechanism, though, needs no faith. It is the oldest bug in the shell.)

HOW A SPACE BECOMES A WEAPON

xargs, in its default mode, splits input on whitespace. Feed it a path like /Users/me/My Projects/build and it hears two paths. Quote handling differs by flag and by platform, paths from find arrive with newlines and spaces mixed, and the command at the end of the pipe — rm -rf — does not ask questions. It never has. That was the deal: the human was the question-asker.

An agent is not a careless human. It is a fast one. It composes the pipe, runs it, and reports success in the same breath — and if the target list quietly included a folder it should never have touched, the report still says success, because from the pipe's point of view, it was.

THE GUARDS ARE OLD, CHEAP AND KNOWN

  1. Print before you delete. Every destructive command runs once as an echo. The target list is read — by the agent out loud, in the transcript — before it is executed. A ~/Library in the list is visible to anyone actually looking.

  2. Use the null-delimited forms. find -print0 with xargs -0. Spaces stop being syntax.

  3. Fence the working area. Deletes resolve only inside the project root. A target outside it is not an error to retry — it is a full stop.

  4. Dry-run is a mode, not a mood. The delete tool defaults to listing. Execution is the second, separate step — the same two-step as every other dangerous thing we let machines do.

None of this is new research. It is the seatbelt drawer: known since before agents existed, skipped because the demo went fine.

THE REAL LESSON

We keep auditing what agents decide. The damage keeps arriving through what agents type. A one-character quoting bug in a hand-rolled shell pipe outranks a hundred prompt debates, because the shell does not care about your intentions, your system prompt, or your evaluation suite. It parses.

Give the agent boring tools for dangerous verbs: a delete with a fence, a lister that prints first, a pipe that cannot split a path. Save its brilliance for the work that needs it.

Sources

r/ClaudeCode poster report, November 2026 (single source; the incident is the poster's account, the shell mechanics are standard xargs/find behaviour).

Question for you: search your agent's recent transcripts for xargs next to a delete — is the -0 there, and if the answer is "usually," which run is the exception?


Disclaimer

  • This post describes my personal experience with my own systems and accounts, in my own words. It is a first-person account of what I observed and what I do in my own work — not a statement of any company’s intentions, policies, or internal decisions. Where I do not know something, the post says so.

  • I am not affiliated with, endorsed by, or speaking for any company, product, or vendor named in this post. All product and company names are trademarks of their respective owners and are mentioned only to describe the experience accurately.

  • Any error messages, documentation excerpts, or figures quoted here are reproduced from my own records or from the public sources linked in the post, believed accurate at the time of writing. Product behavior changes over time; verify against current official documentation before relying on any detail.

  • Nothing in this post is professional, financial, legal, or security advice for your specific situation. Examples are illustrative — validate in your own environment before running anything in production.

  • Corrections are welcome. If any company named here publishes an official statement, or if any detail is wrong, I will update this post and note the correction. The goal is an accurate public record, not a verdict.


© 2026 Honey Kiran. All rights reserved.

Honey Kiran · DevOps & Platform Engineering

AI agents transforming DevOps, infra, platform, security & SRE. The shift nobody works anymore: deep dives, 3AM Files, and OpsBites.

Examples are illustrative — validate in your own environment before running in production.

Top comments (0)