Docs · Worktrees

Isolating agents with git worktrees

Two agents editing one checkout will eventually trample each other's work. Git solved this years ago — git worktree gives each task its own working copy of the same repository — and Atelier makes it the default way to run agents in parallel.

The problem, concretely

A coding agent edits files, switches branches, and commits. Run two of them in the same checkout and one agent's git checkout yanks the branch out from under the other: its build compiles the wrong tree, its commits land somewhere nobody expects. It is not a hypothetical — it is the first thing that happens.

A worktree is a second (third, fifth) working directory attached to the same repository. Same history, same remotes, its own checked-out branch and its own uncommitted files. Agents in different worktrees cannot interfere with each other by construction.

Work Areas and working paths

In Atelier, a Work Area groups the panels of one initiative — the agent, its terminal, a browser, notes. A Work Area can be bound to a working path: your shared checkout, an existing folder, or an isolated worktree that Atelier creates for it.

Once bound, everything in the area inherits the checkout. New terminals open there, and agents launch there — you stop telling every panel where to work, because the area already knows.

Creating one

When you launch an agent, the launcher offers the area's working path as the default; the Advanced step lets you pick a branch and create a fresh worktree instead. If the launcher creates a worktree for an area that had no working path yet, the area adopts it — the next panel you open is already in the right place.

Launching into a checkout where another agent is already live gets you a warning first, so two agents share a working copy only when you decided they should.

Removal is guarded, deliberately

Removing a worktree always goes through a confirmation, and Atelier runs git worktree remove without --force — so git itself refuses to delete a worktree with uncommitted or unmerged work, and the refusal is shown to you rather than papered over. A worktree currently open in a Work Area is locked from removal entirely. Branches and commits are never touched.

The upshot: the worst an errant cleanup can do is fail loudly. Losing work requires git to agree the work is already safe.


Next: running agents in parallel, or the quick start.