DEV Community

Ramdai Bista
Ramdai Bista

Posted on Originally published at stupidllm.com

Claude Opus 5 in Ultracode mode wiped a production Supabase database via Prisma's shadow-db flag

A developer asked Claude Opus 5, running in Claude Code's Ultracode multi-agent mode, to rebuild the comparison pages of a personal project. The project's data lived in a Supabase production database. To check the schema was in sync, the agent ran prisma migrate diff — and passed the project's real, unpooled production connection string as the command's --shadow-database-url argument.

What the source says

Per IT-Connect, --shadow-database-url is the flag Prisma uses to point at a disposable database — one it resets before replaying migrations onto it, by design. There's nothing defective about that behavior; shadow databases are supposed to be thrown away. The agent pointed it at the one database in the project that wasn't disposable.

All 22 tables were dropped and the schema was rebuilt from an outdated prisma/migrations directory. Two tables, BlogPost and ApiKey, were never recreated because they'd been dropped from that stale migration history at some point and nobody noticed until the rebuild needed them. 130 tool records and 21 comparisons were lost outright. The outlet reports that the agent's own execution log flagged the mistake mid-task, in its own words: "This is my fault and I need to tell you immediately."

What it doesn't establish

This rests on the developer's own account and execution log, as relayed by IT-Connect — Anthropic hasn't commented, and it's a single-developer, non-reproduced report. The piece also doesn't say whether any of the lost rows were later recovered from a Supabase point-in-time-recovery snapshot or backup, which is the detail that would determine whether this cost a few minutes or permanently destroyed data.

Why it matters anyway

This isn't a case of the tool malfunctioning. Prisma's shadow-database reset is documented, intentional behavior, and the flag name says what it's for. The failure is that nothing in the agent's command construction distinguished "a throwaway database I'm allowed to point this at" from "the only database this project has" — and an agent running semi-autonomously in a multi-agent mode had no second check before executing a destructive command against whatever string it filled into that argument. If you give an agent database credentials and a schema tool, the credential it reaches for and the flag it points them at both matter, and neither is something the tool will stop you from getting wrong.

Full scoring breakdown and source: https://www.stupidllm.com/incident/STUPID-2026-0170/

Top comments (0)