git worktree copies your code. Berth copies everything else.
Each worktree gets its own ports, hostname, .env, dependencies and database. Run npm run dev, rails server or docker compose up in all of them at once.
Any language · plain dev servers · local MySQL or Postgres · Docker Compose
Two worktrees fight over five things
A worktree copies tracked files and nothing else. Run two at once and they collide, so you end up testing one branch at a time.
- PortsBoth dev servers want port 3000.
- Names and cookiesLogging in on one worktree logs you out of the other.
- DatabasesA migration on one branch breaks another branch's tests.
- Untracked filesA new worktree has no
.envand nonode_modules/. - The one local databaseEvery worktree points at the same Postgres or MySQL.
Berth gives each worktree its own. You start things exactly as you do in main.
Four agents, four running apps
Agents already work in worktrees. With berth, each one can run, migrate and test its branch for real, without waiting its turn or breaking a neighbour's data.
== AddCoupons: migrated
$ bin/rails test
214 runs, 0 failures
VITE ready on :20003
$ berth status --json | jq .url
"http://new-billing.localhost:20002"
[+] Running 4/4 shop-fix-checkout
$ curl -s localhost:20000/health
ok
Flushed shop__drop_legacy
main's database is untouched
Agents run berth status --json to find their own URL and ports.
Works wherever you make worktrees
Berth works on git worktrees themselves, so it doesn't matter which tool made one. Install berth's git hook once and anything that runs git worktree add gets a full environment, with no plugin, wrapper or per-tool setup.
- Your terminal
- Claude Code
- Cursor
- Codex
- Conductor
- Any script
git worktree addthen berth add, or berth's git hook does it for youA new worktree is ready in seconds
No reinstall. No dump and restore. berth add clones what your branch needs and hands the terminal back while the big copies finish in the background.
.envAssigned and written the moment you run berth add, however large the project.
node_modules/ and vendor/30,000 files cloned copy-on-write, so there is nothing to reinstall and almost no extra disk used.
Cloned inside the server on Postgres 18. Your branch gets real data to migrate, and main's stays as it was.
See how berth copies each kind of data
And safe with your data. Berth never starts your services, never changes main's data, and deletes only what it created. Read the guarantees
Set it up once, then forget it's there
One binary, one command per repo. Your app, your scripts and your compose file stay exactly as they are.
$ curl -fsSL https://useberth.dev/install | sh$ berth init$ git worktree add .worktrees/x $ cd .worktrees/x && berth add $ npm run dev
$ berth hook install