When should you use it?
- Your agent can send email, post or push code
- It runs for long periods with little supervision
- You have production systems it can reach
Not for: Short supervised sessions; Agents with read-only access
What do you need, and what do you get?
You need
- A persistent agent setup
- A second model for review
- Backups and command blocklists
You get
- Approve or block decisions on each action
- A log of every decision
- Hard blocks on destructive commands
How does it work, step by step?
- List risky actionsReplies, emails, posts, pushes and database writes.
- Insert a reviewerRoute each risky action through a separate model that approves or blocks.
- Hard-block the worstRefuse destructive database and file commands outright.
- Log everythingWrite each decision and its reason to a log you can audit.
- Back up oftenHis recovery lost several days of data; take snapshots more frequently than that.
The prompt
Our own prompt, inspired by Justin Headley and written to work in Claude Code and Custom agent. Values in lime are placeholders.
Before you send any message, post anything, push code or run a command that writes to a database, describe the action and send it to the reviewer for approval. Never run commands on this blocklist: [list]. Log every proposed action, the reviewer's verdict and the reason to actions.log. If the reviewer blocks it, stop and tell me why.
Inspired by Justin Headley: I Built a Claude Code Agent That Doesn't Need Me Anymore. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.
What can go wrong?
- Memory that grows in one file eventually overwhelms the agent; layer it.
- Commenters wanted a clearer way to audit what the agent is up to.
Our take
Justin Headley's story about a persistent Claude Code agent that erased live data is easy to skim past for the personality bits, but the practical lesson is clear: autonomy needs an independent check and real backups. After restoring from an older backup, he had the agent help build safety gates: a separate model reviews any reply, email or code push before it happens, risky commands are hard-blocked and every decision is logged. That second-model reviewer is cheap insurance. Hard blocks on destructive commands are non-negotiable. Test your restore process before you need it, including how long a restore takes. Keep agent access to production read-only unless there is a strong reason otherwise, and never give blanket write rights to a long-memory session. Review the decision log weekly for near-misses. Prefer human approval for anything that deletes or overwrites data until the gates have proven themselves for weeks. Separate the reviewer model family from the actor when you can afford it.
Where the time goes back: One preventable destructive action costs more than every review check combined.
FAQ
What went wrong?
Did the agent help fix it?
Source and credit
Inspired by Justin Headley. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.
- Inspired by
- I Built a Claude Code Agent That Doesn't Need Me Anymore
- Creator
- Justin Headley
- Published on
- DEV Community (dev.to)
- Original date
- Mar 17, 2026
- License
- Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
- Originally for
- Claude Code
- AI dry run
- Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.