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
How We Turned 12 Years of Expertise Into an AI-Powered Service That Scales
Terrence Ngu Teck Kong has been running Hashmeta Group, a digital marketing agency, for 12 years.
Claude Code vs Codex vs Gemini CLI vs Qwen: My Results
The winner is still Claude Code...
Why Most Sales Presentations Fail
Here are 5 top frameworks for crafting effective sales presentations, each with a different focus depending on your audience, product complexity, and sales c...
Gemini CLI stubbornly insisted its code was right and even did a Google search to prove it with an outdated article.
I was speechless. 😂
We were promised autonomous AI agents. But got Workflow Automation 2.0 instead.
2025: The Year of AI Agents 😄
The most practical use case of a browser agent so far.
"Help me to complete this assignment"
How We Turned 12 Years of Expertise Into an AI-Powered Service That Scales
Terrence Ngu Teck Kong has been running Hashmeta Group, a digital marketing agency, for 12 years.
Why Most Sales Presentations Fail
Here are 5 top frameworks for crafting effective sales presentations, each with a different focus depending on your audience, product complexity, and sales c...
The most practical use case of a browser agent so far.
"Help me to complete this assignment"
Claude Code vs Codex vs Gemini CLI vs Qwen: My Results
The winner is still Claude Code...
Gemini CLI stubbornly insisted its code was right and even did a Google search to prove it with an outdated article.
I was speechless. 😂
We were promised autonomous AI agents. But got Workflow Automation 2.0 instead.
2025: The Year of AI Agents 😄