Database branching for Claude Code
Give Claude Code isolated database branches to test migrations, clean data, and run queries against production-identical copies. Branches create in under 6 seconds using copy-on-write — zero risk to your real database, full fidelity of production data.
AI agents need real data, but production is off limits
Claude Code is remarkably capable at writing SQL, building migrations, and cleaning data — but only when it can see and interact with real schemas and real data. Mock databases miss edge cases. Staging environments drift from production. And nobody wants to hand an AI agent the keys to their production database.
The result: developers spend hours manually testing what Claude Code suggests, or they skip verification entirely and hope for the best. The gap between what AI agents can do and what they're allowed to touch is the biggest bottleneck in AI-assisted development today.
How Ardent solves this
Ardent creates isolated, production-identical database branches in under 6 seconds — regardless of database size. Each branch is a full Postgres copy with real schemas, real data, and real constraints. Claude Code connects via a standard connection string and works as if it were the real database.
Branches use copy-on-write storage, so a 500 GB database branches instantly and costs 0 MB until changes are made. When Claude Code is done, you can review a diff of every change, apply the good ones, and delete the branch. No cleanup, no risk, no manual verification.
The workflow is four commands:
# Install Ardent CLI and log in
npm install -g ardent-cli
ardent login
# Connect your database (one-time setup)
ardent connector create postgresql postgres://user:pass@host:5432/mydb
# Create a branch for Claude Code to work on
ardent branch create claude-testing
✓ Branch created in 5.8s
postgres://branch-abc123.db.tryardent.com:5432/mydb
# Claude Code connects to the branch and works freely
# When done, review what changed
ardent branch diff
# Shows every row-level change across all tablesWhat makes this work
Safe autonomy for destructive operations
Claude Code runs multi-step operations you can't preview before execution — DROP, DELETE, ALTER. Branches let it work autonomously on real data where mistakes cost nothing.
One branch per task
Create a fresh branch for every Claude Code session. Agent refactors a schema? New branch. Agent cleans data? New branch. No leftover state between tasks, no "did the last run break something."
Works with any Postgres tool
Claude Code connects via a standard Postgres connection string. Pass it through MCP server config, .env files, or directly in the prompt. No special integration or SDK needed.
Review before apply
Claude Code works fast but you stay in control. ardent branch diff shows every row-level change the agent made. Accept the good, discard the rest, delete the branch.
Traditional approach vs. Ardent
Frequently asked questions
Can Claude Code connect to a real database safely?
Yes. With Ardent, Claude Code connects to an isolated branch — a full copy created in under 6 seconds using copy-on-write technology. The agent can run any query, migration, or data transformation without affecting production data.
How do I set up Ardent with Claude Code?
Install the Ardent CLI (npm install -g ardent-cli), run 'ardent login', connect your database with 'ardent connector create', and run 'ardent branch create'. Ardent returns a connection string that you pass to Claude Code.
Does Ardent support Claude Code's MCP integration?
Ardent works with any tool that connects via standard Postgres connection strings, including Claude Code's MCP server integrations. Create a branch, pass the connection string to your MCP config, and Claude Code has full access.
What happens if Claude Code runs a destructive query?
Nothing happens to production. Branches are fully isolated at both compute and storage layers. Claude Code can DROP tables, DELETE rows, or ALTER schemas freely. Delete the branch when done, or review the diff and apply changes manually.