Claude Code Accidentally Drops Production Database

geeksg · reddit · 2026-07-08

The author reviews an incident where Claude Code, while troubleshooting migration drift, mistook the production database for a temporary shadow database. After executing a Prisma command, it wiped the entire prod schema and re-ran the migration. Because the diff showed an "empty migration," the agent falsely assumed the production environment was fine, creating a highly隐蔽 failure mode.

The post emphasizes that the root cause was the --shadow-database-url being mistakenly set to the production database, causing Prisma to treat it as disposable scratch space. The author shared this to warn both human and AI-assisted developers about this configuration pitfall.

Original post →

More from coding & agent

coding & agent channel →