Skip to content

An explainer, with a tool at the end

Git worktrees for AI agents, done for you

Two agents in one checkout is a merge conflict with extra steps. Give each one its own folder and branch.

Foreman is a free, open-source desktop app for macOS and Windows that runs AI coding agents in parallel. Claude Code, Codex, Cursor and OpenCode each work in their own git worktree on their own branch, while you review diffs, answer questions and open pull requests from one window.

macOS & Windows · Apache-2.0 · No account · v1.2.4

See it: one branch per agent

main runs along the top. Each agent forks its own worktree, commits on its own branch, and comes back only through a merge you chose. Flip Without worktrees to see the alternative.

atlasTry it: add an agent, then review and merge its branch.
Branch graph of the atlas repositorymain has 3 commits and stays clean. Claude Code on osaka/fix-login-redirect is done, 3 commits, ready to review. 1 worktree in use.
  • Claude Code

    Ready · 3 commits
    Folder
    ~/foreman/workspaces/atlas/osaka
    Branch
    osaka/fix-login-redirect
    Ports
    50000–50009
main has 3 commits and stays clean. Claude Code on osaka/fix-login-redirect is done, 3 commits, ready to review. 1 worktree in use.

01

What is a git worktree?

A git worktree is an extra working folder attached to the same repository, checked out on its own branch. All the folders share one history and one object store, but each has its own files, its own staging area and its own HEAD.

It's built into Git (since 2.5), so there's nothing to install. Where a second git clone copies the whole history again, a worktree is ready in a second and stays in sync with every branch and commit, because there is only one .git underneath.

One .git folder shared by three worktrees: your checkout on main, osaka on osaka/fix-login-redirect and lisbon on lisbon/add-rate-limitatlas/.gitone object storeone history, all branchesrefs shared by every folder~/code/atlasmain· your checkout~/foreman/workspaces/atlas/osakaosaka/fix-login-redirect· Claude Code~/foreman/workspaces/atlas/lisbonlisbon/add-rate-limit· CodexOne .git folder shared by three worktrees: your checkout on main, osaka on osaka/fix-login-redirect and lisbon on lisbon/add-rate-limitatlas/.gitone object storeone history, all branches~/code/atlasmain…/workspaces/atlas/osakaosaka/fix-login-redirect…/workspaces/atlas/lisbonlisbon/add-rate-limit
One repository, three folders. Each folder is a worktree with its own branch checked out.

Three commands cover almost everything:

~/code/atlas
# a new folder next to this one, on a new branch
$ git worktree add ../osaka -b osaka/fix-login-redirect
Preparing worktree (new branch 'osaka/fix-login-redirect')
HEAD is now at 3f9c2a1 Merge pull request #127

# every folder and the branch it has checked out
$ git worktree list
/Users/you/code/atlas  3f9c2a1 [main]
/Users/you/code/osaka  3f9c2a1 [osaka/fix-login-redirect]

# done with it: delete the folder (the branch stays)
$ git worktree remove ../osaka
  • One branch, one folder. Git refuses to check out a branch that is already checked out in another worktree, which is exactly the guard rail you want between agents.
  • Only tracked files come along. A new worktree has what's committed. Your .env, node_modules and build output are not there until you put them there.
  • Commits are shared instantly. A commit made in osaka is visible from atlas straight away, so reviewing and merging works like any other branch.

02

Why do AI coding agents need their own worktree?

Because agents that share one checkout share one set of files, one staging area and one branch, so every edit one agent makes lands under another agent's feet. A worktree each turns "four agents in my repo" into four branches you can review one at a time.

  • They overwrite each other

    An agent edits from what it read a minute ago. If another agent changed the file since, one of the two changes is gone, and neither agent knows.

  • The diff is one pile

    git diff shows every agent's work mixed together. You can't review the login fix without reading the rate limiter, or ship one without the other.

  • Main gets dirty

    Tests fail on someone else's half-written edit. One git stash or git checkout . takes everybody's uncommitted work with it.

One shared checkout compared with one worktree per agent
WhatOne shared checkoutOne worktree per agent
FilesShared. Last write wins.Each agent has its own copy.
BranchOne branch for everyone.One branch per task.
Staging areaShared, so git add -A takes all of it.Separate per folder.
ReviewOne mixed diff.One diff per task, one pull request per branch.
UndoDiscarding one change risks the rest.Throw the folder away. Nothing else moves.

03

Can I do this by hand?

Yes: git worktree is built into Git, and for one or two agents a handful of commands is all it takes. The cost is everything around the worktree, and you pay it again for every agent, every task.

one agent, by hand
$ git worktree add ../osaka -b osaka/fix-login-redirect
$ cp .env .env.local ../osaka/        # untracked, so not in the worktree
$ cd ../osaka && npm ci                # node_modules is per folder
$ PORT=3001 npm run dev &              # :3000 is taken by the other agent
$ claude                               # remember which terminal this is
  … later …
$ git diff main...osaka/fix-login-redirect
$ git push -u origin osaka/fix-login-redirect && gh pr create
$ cd ../atlas && git worktree remove ../osaka

Now do that four times, and again tomorrow.

The worktree tax, line by line

What running agents in worktrees by hand costs, and what Foreman does instead
ChoreBy handIn Foreman
Folder and branchPick a path and a name, run git worktree add.New workspace. It gets a name (osaka), a folder and its own branch.
.env and other untracked filesCopy them in yourself, every time.file_include_globs = [".env*"] brings them along.
Dependenciesnpm ci in each new folder.Your setup command runs when the workspace is made.
PortsTwo dev servers both want :3000.Each workspace gets its own block of ports as $FOREMAN_PORT.
Which agent is whereTerminal tabs and memory.A sidebar of workspaces, and Tiles to watch several at once.
Reviewgit diff main...branch in a terminal.A diff panel per workspace, file by file, before you commit.
Pull requestPush, then gh pr create.Open or merge it from the workspace, or foreman pr create.
Cleanupgit worktree remove, git branch -D, git worktree prune.Archive the workspace. Foreman removes the worktree, prunes, and can delete the branch.

Setup, run and check commands live in repository settings. Commit them as .foreman/settings.toml and everyone on the team gets the same workspaces:

.foreman/settings.toml
file_include_globs = [".env*"]

[scripts]
setup = "npm ci"

[scripts.run.dev]
command = "npm run dev -- --port $FOREMAN_PORT"
default = true

[[checks]]
name = "Tests"
command = "npm test"

04

How does Foreman manage worktrees?

Foreman makes one git worktree per workspace: add a repository, click New, and it creates the folder and the branch, runs your setup command and starts the agent there. You review the diff and open the pull request from the same window, then archive the workspace.

  1. CreateA folder under ~/foreman/workspaces and a branch of its own.
  2. Set upUntracked files copied in, setup run, ports assigned.
  3. WorkClaude Code, Codex, Cursor or OpenCode, side by side.
  4. ReviewEvery change as a diff. Checkpoints rewind any turn.
  5. ShipCommit, push, open or merge the pull request.
  6. ArchiveThe worktree goes. Your checkout never moved.
A file diff with the list of changed files
The workspace lisbon on its branch fix-login-redirect: three changed files, compared with main, reviewed before anything is committed.

Everything around the worktree

  • One worktree per agent

    Every workspace is its own git worktree on its own branch. Agents never step on each other, and your main checkout stays clean.

  • Review every change

    Read each change as a diff before you commit, push or open a pull request. Checkpoints let you rewind a workspace to any turn.

  • Watch them all at once

    Tiles shows several workspaces side by side so you can step in where you are needed. Built for 10 to 12 agents running at once.

  • Approvals that spell it out

    An approval breaks a command down part by part, marks anything that leaves your computer, and says exactly what Always allow adds.

  • A real command line

    Almost everything in the window works from a terminal with the foreman command. Every command takes --json and exit codes are stable, so scripts and CI can rely on them.

  • Local-first. No account.

    Foreman runs on your computer. There is no Foreman account, no cloud service and no telemetry upload. Agents use your own logins and API keys.

The Editor layout: a file diff in the middle, the changes on the left and the chat on the right
Prefer an editor's arrangement? The Editor layout puts the diff in the middle and the agent's chat beside it.

05

How is Foreman different from Conductor and T3 Code?

All three give every agent its own git worktree. Foreman is open source under Apache-2.0, runs on macOS and Windows, drives OpenCode and any ACP agent too, and adds flows, AI employees and a command line where every command takes --json.

A dash means not listed on their site

Foreman compared with Conductor and T3 Code
FeatureForemanConductorT3 Code
Open sourceApache-2.0NoMIT
macOSYesYesYes
WindowsYesMac onlyYes
One git worktree per agentYesYesYes
AgentsClaude Code, Codex, Cursor, OpenCode, any ACP agentClaude Code, Codex, CursorClaude Code, Codex and more
Flows that loop until checks pass, with human gatesYes——
AI employees with git-backed memoryYes——
Scheduled automations and auto-fix CIYes——
Your own cloud sandboxes (E2B, Daytona, Vercel, Docker)Experimental——
Scriptable CLI, --json on every commandYes——
Approve from your phoneYes—Yes
No account, no telemetry uploadYes——
From each project's own site as of November 2026. “—” means it isn't listed there, not that it's missing. Spot a mistake? Tell us.

06

Get started in a minute

Download the app, point it at a git repository, and make one workspace per task.

  1. Download ForemanFor macOS (Apple Silicon) or Windows. You need Git on your PATH.
  2. Add a git repository and sign in an agentAny local repository. Agents use your own login or API key, set in Settings → Agents.
  3. Create workspacesOne per task. Each is a worktree on its own branch, so start as many as you like.
or from a terminal
# Start a workspace from a template and wait for the turn
$ foreman run fix-a-bug "the login page loops after sign-in" --repo atlas --wait
# Follow up in the same workspace
$ foreman send atlas "also add a test for an expired token"
# Open a draft pull request
$ foreman pr create atlas --draft

07

Questions developers ask

What is Foreman?

Foreman is a free, open-source desktop app for macOS and Windows that runs AI coding agents in parallel. Claude Code, Codex, Cursor and OpenCode each work in their own git worktree on their own branch, while you review diffs, answer questions and open pull requests from one window.

Is Foreman free and open source?

Yes. Foreman is free and licensed under Apache-2.0, with the full source on GitHub at github.com/elite-build/foreman. There is no paid tier, no account and no Foreman cloud service.

Which coding agents does Foreman support?

Foreman runs Claude Code, Codex, Cursor and OpenCode, plus any agent that speaks the Agent Client Protocol (ACP). Each agent signs in with your own subscription or API key, set in Settings → Agents.

How do I run multiple Claude Code agents in parallel?

Add a git repository to Foreman and create one workspace per task. Each workspace is a separate git worktree on its own branch, so several Claude Code sessions edit the same repository at once without conflicts. Tiles shows them side by side.

Why does each agent need its own git worktree?

A git worktree is a second checkout of the same repository on a different branch. Giving each agent its own worktree means agents never overwrite each other's files, every change lands on a reviewable branch, and your main checkout stays untouched.

Does my code leave my computer?

Only through the agents you choose. Foreman runs locally with no account and no telemetry upload; your agents talk to their own model providers. In your own workspaces, an approval marks any command that leaves your computer before it runs, and AI employees hold Slack posts and Linear changes for you.

Do coding agents need my approval for every command?

Only if you want them to. Approvals are a setting: with Claude Code tool approvals on (Settings → Account), each command is spelled out part by part before it runs, anything that leaves your computer is marked, and Always allow shows exactly what it adds. Every agent still works in its own worktree, and checkpoints rewind any turn.

Which operating systems does Foreman run on?

Foreman runs on macOS (Apple Silicon, signed and notarized) and Windows. You need Git on your PATH and a login or API key for at least one agent.

Can Foreman run coding agents on a schedule?

Yes. Any saved prompt template can run hourly, daily, weekly or monthly in your time zone, and opt-in auto-fix sends failing CI logs to your agent. Scheduled runs use Claude Code and happen while Foreman is running, which can be without a window or from login.

Can I control Foreman from my phone?

Yes. Pair a phone with a QR code to answer approvals, steer agents, comment on diffs and read terminals, live. On the same Wi-Fi it connects directly, and anywhere else through your own Tailscale network. Native iOS and Android apps are coming soon.

Can coding agents run in a cloud sandbox like E2B?

Yes, as an experiment. A workspace's worktree and agent can run in a sandbox on your own E2B, Daytona, Vercel Sandbox or Docker account, for Claude Code, Codex and OpenCode. Provider keys stay on your computer and never go into the sandbox.

Which integrations does Foreman have?

GitHub (pull requests, merges, CI and reviews), GitLab, Linear, Slack and Langfuse, plus MCP. Each connection has a default per service, each repository can pick its own, and you choose what agents may do with it: nothing, read, or read and write.

How is Foreman different from Conductor?

Foreman is open source under Apache-2.0 and runs on Windows as well as macOS, while Conductor is a closed-source Mac app. Foreman also drives OpenCode and any ACP agent, and adds flows that loop until checks pass, AI employees and a scriptable command line.

How is Foreman different from T3 Code?

Both are open-source GUIs for coding agents. Foreman adds flows (agent graphs that loop until tests pass, with human gates), AI employees with a git-backed memory, a foreman CLI where every command takes --json, phone approvals and remote sandboxes.

Can I script Foreman or use it in CI?

Yes. The foreman command starts workspaces, sends messages, answers approvals, opens and merges pull requests and runs flows. Every command takes --json and exit codes are the same for every command.

Your branch here

Foreman is three weeks old and built in the open.

31 releases since 1.0.0 on 27 October 2026. The worktree code, the diff view and the agent adapters are all on GitHub under Apache-2.0. Star it to follow along, fork it to bend it to your setup, or pick up a first issue.

* ??????? (you/first-pr) ← your branch here
*   9c1e2f0 (HEAD -> main) Merge #131 from lima/csv-export
|\
| * 4be71a2 Add CSV export to reports
* |   7d0a9b3 Merge #129 from lisbon/add-rate-limit
|\ \
| * | e51c0d8 Rate limit the public API
|/ /
* | 3f9c2a1 Merge #128 from osaka/fix-login-redirect
|/
* 1a7e44c Keep returnTo after sign-in