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.
~/code/atlas on main · one folder, four agents
src/login.tssrc/api/server.tssrc/session.tspackage.jsonpackage-lock.jsonsrc/reports/export.ts
Result: main is dirty, the diff is one mixed pile, and nobody can tell which line came from which agent.
- Claude Code edits src/login.ts to keep returnTo after sign-in.
- Codex edits src/api/server.ts to add the rate limiter.
- Cursor is halfway through refactoring src/session.ts.
- Codex rewrites src/login.ts from a copy it read a minute ago. Claude Code’s returnTo is gone.
- Claude Code runs npm test, hits Cursor’s half-finished session.ts and starts “fixing” it.
- OpenCode runs npm install for a CSV library. The lockfile changes under everyone.
- OpenCode runs git add -A && git commit -m "csv export". Everyone’s work is now one commit on main.
- Cursor runs git stash to start over, and stashes what the others hadn’t committed yet.
-
Claude Code
Ready · 3 commitsosaka/fix-login-redirectcompared withmainsrc/login.ts+2 −2src/redirect.ts+4
@@ -6,2 +6,3 @@ src/login.ts-export async function login(credentials: Credentials) {+export async function login(credentials: Credentials, returnTo = "/") {- return fetch("/api/login", { body: JSON.stringify(credentials) })+ return fetch("/api/login", { body: JSON.stringify({ ...credentials, returnTo }) })
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.
Three commands cover almost everything:
# 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_modulesand build output are not there until you put them there. - Commits are shared instantly. A commit made in
osakais visible fromatlasstraight 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 diffshows 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 stashorgit checkout .takes everybody's uncommitted work with it.
| What | One shared checkout | One worktree per agent |
|---|---|---|
| Files | Shared. Last write wins. | Each agent has its own copy. |
| Branch | One branch for everyone. | One branch per task. |
| Staging area | Shared, so git add -A takes all of it. | Separate per folder. |
| Review | One mixed diff. | One diff per task, one pull request per branch. |
| Undo | Discarding 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.
$ 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 ../osakaNow do that four times, and again tomorrow.
The worktree tax, line by line
| Chore | By hand | In Foreman |
|---|---|---|
| Folder and branch | Pick 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 files | Copy them in yourself, every time. | file_include_globs = [".env*"] brings them along. |
| Dependencies | npm ci in each new folder. | Your setup command runs when the workspace is made. |
| Ports | Two dev servers both want :3000. | Each workspace gets its own block of ports as $FOREMAN_PORT. |
| Which agent is where | Terminal tabs and memory. | A sidebar of workspaces, and Tiles to watch several at once. |
| Review | git diff main...branch in a terminal. | A diff panel per workspace, file by file, before you commit. |
| Pull request | Push, then gh pr create. | Open or merge it from the workspace, or foreman pr create. |
| Cleanup | git 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:
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.
- CreateA folder under
~/foreman/workspacesand a branch of its own. - Set upUntracked files copied in,
setuprun, ports assigned. - WorkClaude Code, Codex, Cursor or OpenCode, side by side.
- ReviewEvery change as a diff. Checkpoints rewind any turn.
- ShipCommit, push, open or merge the pull request.
- ArchiveThe worktree goes. Your checkout never moved.

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.

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
| Feature | Foreman | Conductor | T3 Code |
|---|---|---|---|
| Open source | Apache-2.0 | No | MIT |
| macOS | Yes | Yes | Yes |
| Windows | Yes | Mac only | Yes |
| One git worktree per agent | Yes | Yes | Yes |
| Agents | Claude Code, Codex, Cursor, OpenCode, any ACP agent | Claude Code, Codex, Cursor | Claude Code, Codex and more |
| Flows that loop until checks pass, with human gates | Yes | — | — |
| AI employees with git-backed memory | Yes | — | — |
| Scheduled automations and auto-fix CI | Yes | — | — |
| Your own cloud sandboxes (E2B, Daytona, Vercel, Docker) | Experimental | — | — |
| Scriptable CLI, --json on every command | Yes | — | — |
| Approve from your phone | Yes | — | Yes |
| No account, no telemetry upload | Yes | — | — |
06
Get started in a minute
Download the app, point it at a git repository, and make one workspace per task.
- Download ForemanFor macOS (Apple Silicon) or Windows. You need Git on your PATH.
- Add a git repository and sign in an agentAny local repository. Agents use your own login or API key, set in Settings → Agents.
- Create workspacesOne per task. Each is a worktree on its own branch, so start as many as you like.
# 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