Documentation

Isolated worktrees

Every agent can work on its own copy of your repo, so parallel work never collides. Setup scripts make fresh copies instantly runnable.

Why isolation matters

Two agents editing the same checkout will collide: half-finished changes from one bleed into the other's diffs, tests, and commits. A git worktree solves this — it is a second working copy of the same repository, on its own branch, in its own folder. Atelier creates, sets up, and cleans up worktrees for you; you never have to touch git worktree yourself.

Branch, worktree, or in place?

When you start an agent you choose where it works:

ChoiceWhat happensUse when
New worktreeA fresh branch and an isolated copy of the repo, set up automatically.Parallel work — the default for anything substantial.
New branchA new branch in the shared checkout.One agent at a time, and you want the work on a branch.
Existing refThe agent joins a branch or worktree that already exists.Continuing or pairing on work already in flight.
In placeThe agent runs directly in the folder.Plain (non-git) folders, or quick untracked experiments.

Worktree setup

A brand-new worktree is a clean copy — dependencies, env files, and build output from your main checkout are not there. So the first time a project gets a worktree, Atelier runs a one-time setup script to make it runnable (think npm install, copying .env, a first build).

  • Per-project scripts live in Settings ▸ Worktree, where you can view, edit, or delete the script for each project in a full-screen editor.
  • AI-authored scripts: with the toggle on, an agent inspects the project and writes the setup script for you the first time one is needed. You pick which model authors it, and can tune the authoring prompt.

The setup gate

While setup runs, the agent's composer is disabled and reads "Waiting for worktree to setup…", and its sidebar row shows Setting up worktree…. A prompt you have already dispatched is held and sent automatically the moment setup settles, so you can fire-and-forget: create the agent, type the task, move on. If setup fails, the prompt is sent anyway — agents are usually capable of finishing the setup themselves — and the ref row gets a to re-run the script.

Good to know. Worktrees are real folders inside your repository's .worktrees/ directory (git-ignored automatically). Your dev server, editor, and terminal tabs can all point at one — Atelier's terminal and browser tabs open there by default, so what you preview is what the agent actually built.