One git worktree per task

Every microManager workspace is a real git worktree on its own branch, so each agent edits its own copy of the repository while sharing one .git folder. microManager creates it, copies in your ignored files, reserves ports and runs your setup script, then removes it when you archive the workspace.

Updated

The New workspace dialog over the app: repository ledger-api, a new branch from main, a name to be set from the first message, agent Claude Code, model Haiku, effort Agent default, mode Accept edits, and a first message asking it to reject account names longer than 60 characters.
A new workspace is a git worktree on its own branch, with an agent ready to work in it.

Why does each agent need its own worktree?

Agents edit files, run builds and start servers. Two of them in one checkout step on each other: one agent’s half-finished edit breaks the other’s tests, and both try to start a dev server on the same port. Separate clones avoid that but are slow to make and keep separate copies of the history. A git worktree is the middle path: a separate folder and branch per task, sharing one .git object store.

What does microManager set up for each worktree?

Step What happens
Branch A new branch from the base you pick, named after a city (<prefix>/lisbon) and renamed after your first message unless you turn that off
Worktree git worktree add into ~/micromanager/workspaces/<repository>/<city>
Ignored files .env and other ignored files copied in from your main checkout
Ports Ten ports reserved, the first in MICROMANAGER_PORT
Setup Your setup script runs in a terminal you can watch
Shared notes A .context/ folder git ignores, for notes agents share

Details are in the workspaces docs.

How are ignored files handled?

A fresh worktree only has committed files. microManager copies the rest from your main checkout using .worktreeinclude, or file_include_globs from your repository settings, or .env* by default, and it never overwrites a file that already exists. See files to copy.

How do ports work when several dev servers run?

Each workspace gets ten ports of its own, starting at a multiple of 10 from 51000 up. Start servers on $MICROMANAGER_PORT (or $CONDUCTOR_PORT in scripts written for Conductor) and every workspace can run its dev server at the same time. See environment variables.

What happens to the worktree when I am done?

Archiving runs your archive script, saves any uncommitted work as a hidden git commit, removes the worktree folder and keeps the branch, so the disk space comes back and only ignored files such as node_modules are gone. You can restore an archived workspace later, at the same path, on the same branch, with its uncommitted work back in place.

Does this work with the worktrees Conductor made?

Yes. Importing from Conductor registers each existing worktree where it already is, on its existing branch. Nothing is moved, copied or rewritten.

Where to go next

Frequently asked questions

What is a git worktree?

A git worktree is an extra working folder attached to the same repository. Each worktree has its own branch and files, but they all share one object store, so a new worktree is quick to create and costs little disk space compared with a second clone.

Are worktrees a security boundary?

No. Worktrees keep agents from editing the same files, but every agent still runs as your user on your computer. Use each agent's own permission settings to limit what it may do.

Can I open a workspace in my editor?

Yes. The Open in menu opens the worktree in VS Code, Cursor, Zed or Windsurf on every system, plus Finder, Terminal, iTerm or Xcode on a Mac, File Explorer or Windows Terminal on Windows, and your file manager or terminal on Linux. It can also open the branch on GitHub.

Get microManager

Free, no account, for macOS, Windows and Linux. It runs the agent CLIs you already have installed and signed in.

curl -fsSL https://micromanager.win/install.sh | sh

That installs it on macOS and Linux. On Windows, paste this into PowerShell:

irm https://micromanager.win/install.ps1 | iex