Git worktrees or a machine per agent?
Use worktrees when your agents only read and edit code. Use a machine per agent when they also build, run and test it. A worktree gives each agent its own checkout on its own branch, but every agent still shares one computer: its ports, processes, memory, databases and installed tools. If your agents clobber each other's dev servers or test databases, worktrees aren't enough.
Worktrees are a good start. The trouble shows up later, as strange failures that aren't anybody's bug. A test passes alone and fails when another agent is running. A dev server won't start because the port is taken. The laptop slows to a crawl in the middle of three builds.
What it looks like
Three agents are working on one repository on a laptop, each in its own worktree. Two of them start the dev server and both want port 3000. The third resets the local test database halfway through the second one's integration tests. Each agent's code is fine. They just can't share a computer.
In Harmux each of those agents would have had a machine of its own, with its own ports, its own database and its own CPU, and all three would have finished.
What a worktree separates, and what it doesn't
| Worktree per agent | Machine per agent | |
|---|---|---|
| Files and branch | Separate | Separate |
| Ports | Shared: two dev servers want the same port | Separate |
| Processes | Shared: one agent's pkill node stops the others' | Separate |
| Databases and containers | Shared, unless you script one per worktree | Separate, with Docker on each machine |
| CPU, memory, disk | Shared with every agent and with you | Each machine has its own |
| What an agent can touch | Your whole computer | Its own machine, plus the repositories and services you give it |
When worktrees are enough
If you run two or three agents at once on a fast computer, and they edit code and run unit tests without servers or fixed ports, worktrees do the job, and keep everything on your own machine with your local tools. Desktop apps such as Conductor build on worktrees and do this well.
When you need a machine per agent
You need one when agents start dev servers, end-to-end tests or local APIs on fixed ports, when tests reset a shared database, or when several builds at once slow your laptop to a crawl. You also need one when you want agents to work without approval prompts and without access to your own computer.
You can renumber ports and script a database per worktree, but every new service needs the same treatment, forever. A machine per agent removes the problem instead of working around it, and it's how you run more agents than one laptop can hold. Running those machines yourself is a job of its own, though: provisioning each one, keeping its tools current and secure, and connecting agents across machines. The hard part isn't setting it up once, it's keeping it working.
What you get in Harmux
Harmux does that part for you. Every Session gets its own machine and disk, with Docker inside, so Postgres, Redis or your whole compose stack runs next to the agent without touching anyone else's. The agents are the real Claude Code and Codex, so your repository's instructions, Skills and MCP servers work as they do on your laptop. Each Project can install your tools on every new machine, so every agent starts from the same place, and an agent can write that setup for you. Machines are sized to the job, grow their disks as they fill and pause when idle, and finishing a Session deletes the machine, so nothing is left behind on your laptop.
Machines start at $0.11 an hour while they run, and a paused one costs only its storage (prices).
Set it up
Get started at harmux.com, connect GitHub and a Claude or ChatGPT account, and start a few Sessions on the same repository. Each runs its own dev server, database and tests:
hmux new --project-name app --repo https://github.com/acme/app "Add rate limiting to the API"