Vibe coders, this old news will happen to you sooner or later.
Unless you set up your project correctly.
Unless you set up your project correctly.
If you don’t know what I am talking about below, my advice is to hire a senior software engineer ASAP. Not just a junior engineer who can vibe code, but a senior who knows what they are doing.
I saw someone filing this as a bug to Claude Code. The bad news? This “bug” can’t be fixed. If you know the fundamentals of LLMs, you will know this is not a bug. It is a feature of LLMs by design.
An LLM is a probabilistic machine.
Even if you give it instructions not to reset your DB in CLAUDE.md, there is no guarantee it will follow them.
This is based on my own experience: I have told Claude Code not to run database migrations during development. It still does it once in a while, maybe 5% of the time—after finishing coding a feature.
Why? Because it is common practice to do this during development. The probabilistic nature of LLMs means there is a high chance it will do it even if you instruct it not to.
I run Claude Code with —dangerously-skip-permissions, but I never worry about this. Because if you set up your project properly, this is a non-issue.
Here is how you should set up your project to be “AI disaster-proof”:
-
Strict Infrastructure Isolation
-
Never, ever use your production database during development.
-
Set up another database, ideally a local one, for development.
-
Use a database framework that can generate migration files.
-
Review the migration files for any destructive statements.
-
Test the migration against a cloned production instance.
-
Apply it manually to your production environment only when you are sure.
-
Bonus: You can ask an LLM to review the migration file for risks.
-
Strict Environment Isolation
-
Never, ever put production credentials in a place where an AI agent can read them during development.
-
Your .env file should only contain local/dev credentials.
-
AI cannot delete what it cannot access.
-
Automate Daily DB Snapshots
-
Point (2) might not be possible for some platforms, or things may go wrong during DB migration.
-
If the AI manages to wipe your database (and it will), you need a way to recover.
-
Set up an automated daily snapshot of your production database.
-
If disaster strikes, restoring from yesterday’s backup turns a catastrophe into a minor annoyance.
-
Use Version Control, e.g. Git
-
This is not for the database, but for the code.
-
LLMs will mess up your code once in a while.
-
Git is your ultimate undo button for code.
-
If something breaks, roll it back.
Don’t blame the probabilistic machine. Architect your system so that probability doesn’t matter.
And sorry, there is no fix to the “bug”. It is a feature.
I repeat: If you don’t know what I’m talking about, it is time to hire a senior software engineer.
#AI #SoftwareEngineering #ClaudeCode #VibeCoding #ProgrammingTips
Enjoyed this? Subscribe for more.
Practical insights on AI, growth, and independent learning. No spam.
More in Vibe Coding
The votes are in for Cohort 3.
Congrats to Francis Lee ., the winner of the portable monitor from my Foundations of Claude Code workshop.
“Amara’s Law and the Long Game of AI”
There’s so much inflated expectation of AI that our enthusiasm will wane after hitting reality in short-term. A bubble will burst. And it will continue to gr...
From insight to action: AI is not the future—it’s the now.
At the Business+AI Forum 2024, our speakers shared groundbreaking insights on how AI is transforming industries, creating opportunities, and solving real-wor...
I am attending the Agentic AI Conference by Data Science Dojo on May 27 and 28, 2025.
The conference speakers include thought leaders in industry who will talk about all aspects of building agentic AI applications - covering everything from cu...
AI has little impact on world productivity. Why I'm not surprised.
Recently, Anthropic CEO, Dario Amodei warns AI could wipe out 1 in 2 white collar jobs in next five years. Many quickly tried to prove him wrong by quoting a...
Are you struggling to get more leads?
Join us to discover why AI+SEO is the new opportunity and how AI is killing traditional SEM.
The votes are in for Cohort 3.
Congrats to Francis Lee ., the winner of the portable monitor from my Foundations of Claude Code workshop.
I am attending the Agentic AI Conference by Data Science Dojo on May 27 and 28, 2025.
The conference speakers include thought leaders in industry who will talk about all aspects of building agentic AI applications - covering everything from cu...
AI has little impact on world productivity. Why I'm not surprised.
Recently, Anthropic CEO, Dario Amodei warns AI could wipe out 1 in 2 white collar jobs in next five years. Many quickly tried to prove him wrong by quoting a...
“Amara’s Law and the Long Game of AI”
There’s so much inflated expectation of AI that our enthusiasm will wane after hitting reality in short-term. A bubble will burst. And it will continue to gr...
From insight to action: AI is not the future—it’s the now.
At the Business+AI Forum 2024, our speakers shared groundbreaking insights on how AI is transforming industries, creating opportunities, and solving real-wor...
Are you struggling to get more leads?
Join us to discover why AI+SEO is the new opportunity and how AI is killing traditional SEM.