Skip to main content

What's new

Running several agents on one machine: what needs its own copy

The Compare dialog in 1904 for Move image uploads to a background job, 3 agents: Claude Code Ready for Review with 5 files and +186 −44, Codex Working with 4 files, and a second Claude Code Working with 7 files, each with an Open button and Keep this one on the finished row.

This week brought a handful of new open-source apps whose main job is giving each coding agent its own copy of your code. That says a lot about how much hand-built setup people are carrying to run agents side by side. A second checkout keeps two agents out of each other's files, and it's the easy part. What still collides is everything outside the folder.

Files are the part everyone solves

Two agents in one working folder overwrite each other's edits, and each one runs its tests against a mix of both changes. So give each agent its own checkout on its own branch. Git can make a second working copy that shares the repository's history, which keeps it cheap on disk and quick to create. Name the branch after the task, so that when you come back to five of them you can tell which is which.

Two dev servers can't share one port

The second agent to start the app finds the port already taken. Depending on the framework, it either fails, which is the good outcome, or quietly takes the next free port while you keep testing the first copy in your browser and wonder why nothing changed. Read the port from an environment variable and give each copy its own, written into that copy's local settings when you create it.

A shared database is where the strange failures come from

If every copy points at the same local database, one agent's migration changes the tables under all the others. Their tests start failing for reasons unrelated to their own work, and they go off fixing code that was fine. Give each copy its own database: a separate schema, a separate file if you use SQLite, or a throwaway container, created and seeded by a script. It takes a minute per copy and saves the afternoon you'd otherwise spend working out which agent broke what.

The files every task wants to touch

Lockfiles, the list of migrations and the notes file your agents read change in many tasks at once, so they conflict when the work lands. Keep dependency upgrades to one task at a time. Land finished work one task after another and bring the others up to date with main as each one goes in, rather than merging three at the end. Your secrets need a decision too. A fresh checkout doesn't include your untracked environment file, and copying it into every folder multiplies the places your keys live, so have each copy load it from one place outside the repository.

Make it one command

None of this is hard, which is exactly why it turns into months of small fixes. Put it in one script that takes a task name and makes the checkout and branch, picks a free port, creates and seeds the database, installs dependencies and points at the environment file, with a second script that tears it all down again. Then keep an eye on the machine itself. Three test suites and three dev servers at once can be more than a laptop handles comfortably, and when every agent feels slow, the bottleneck is usually the laptop.

How 1904 handles it

In 1904 each task runs in the cloud, on its own branch, in its own isolated copy of your code, so nothing runs on your laptop unless you connect it with Use my computer and approve what the agent runs there. Each task's Preview runs that task's version of your app. Notes that two tasks add to AGENTS.md at the same time are merged for you, and when you submit several tasks at once, 1904 merges them one at a time. Tasks on the same app do share one database for their previews, your app's development database and never your live data. A preview doesn't run a task's unmerged migrations, so one task's schema change can't reach the tables the others are using.

← All posts

Start with an idea, or start with what you have.

Use AI supplied by 1904, or connect the subscription you already pay for.