Let your coding agent make its own worktrees

Install the Mergepond plugin in Claude Code, answer one question about how the agent should work in your repository, and from then on it starts each task in a worktree of its own, set up by your recipe, and tells the Worktrees tab when the work is ready to look at. You review the branch in Mergepond and remove the worktree when you are done. The last section does the same for Codex.

Updated 10 November 2026

What the plugin changes

Run coding agents in parallel has you make a worktree with ⌘N, open a terminal in it and start the agent there. That works with any agent and needs nothing installed. The plugin moves the first two steps to the agent: it makes the worktree itself, through pond, the command line tool and MCP server that comes with Mergepond, and works there. And because pond marks worktrees on the agent's behalf, the board shows "Claude Code working" and "Claude Code: ready for review" with the agent's own note, instead of guessing from changed files.

Everything in this guide is free. The board that shows the marks is part of Pro from Mergepond 1.0.7; on Free, pond list in a terminal shows the same.

Install the plugin

  1. Install Mergepond 1.0.6 or later and open your repository in it once. pond lives inside the app; you don't need to put it on your PATH for Claude Code, though Mergepond › Install Command Line Tool… does that if you want to run pond yourself.
  2. Press ⌘3 and click the gear. Fill in the setup recipe if you haven't: copy .env, link node_modules, run your install command, so an agent's worktree can run the project at once. Worktrees that set themselves up walks through it. Save.
  3. In Claude Code, run /plugin marketplace add Webb-Ventures/mergepond-plugins, then /plugin install mergepond@mergepond.

The plugin adds the mergepond MCP server, a skill that tells Claude when and how to use worktrees, and two hooks that keep the board current. Coding agents lists every tool and command.

The first prompt

Start Claude Code in the repository's main folder and give it a task that changes code. Before it touches anything, it asks how you want it to work in this repository. There are three answers:

AnswerWhat happens next
Always in a worktreeEvery task that changes code starts in a new worktree.
Only when you askClaude works in the folder it started in, and makes a worktree when you ask for one.
Ask before each taskClaude asks, each time, whether this task should get a worktree.

Pick the first. Claude saves the answer to .mergepond.local.toml at the root of the repository, which Git ignores, so it asks once per repository and not again. You can see and change the choice in Worktree settings, under Coding agents; tick Share with the team there to put it in .mergepond.toml and commit it, so everyone on the team gets the same behaviour.

The agent makes a worktree

Having an answer, Claude calls create_worktree with a few words about the task. pond names a branch from the pattern in Worktree settings, agent/<agent>/<task> by default, so "fix the login redirect" becomes agent/claude-code/fix-the-login-redirect, checks it out in a folder beside your repository, runs your recipe, and marks the worktree working with the note Claude wrote. Claude then runs its commands and edits its files in that folder, and nothing changes in yours.

A long recipe doesn't hold things up. create_worktree answers within 50 seconds, and if the install is still running Claude waits for it with worktree_status before trying to run the project. If a step fails, the worktree is still there and Claude tells you what failed.

To steer the branch name or the starting point, say so in the prompt: "work on the fix/login branch" has Claude pass branch, and "check out pull request 412" has it pass pr.

Watch it in Mergepond

The board while Claude Code works: the card reads Claude Code working, with Claude's note under it.

Press ⌘3. The new worktree is a card in the Working column with the pill "Claude Code working" and Claude's note. You don't need to refresh; Mergepond watches the folder and reads the marks pond writes.

The two hooks keep the pill true to what is happening:

  • When you send Claude a message, the worktrees it made this session are marked working.
  • When Claude stops, the ones still working are marked ready for review, and the card moves to the Ready for review column with "Claude Code: ready for review".

When Claude thinks a piece of work is ready, it also marks the worktree for review itself, with a note saying what is there, such as "Login redirect fixed, tests added". When it has nothing more to do there, it marks it done. Either way, the card is in Ready for review and the note tells you what to look at.

Start a second task in another Claude Code session, and it gets its own worktree and its own card. Six cards on the board is a normal afternoon.

Review, then remove

  1. Click the card's "Open" to open the worktree in a new window, and press ⌘2 for History. Claude's commits sit above your default branch; click each to read the diff.
  2. If the branch needs more, go back to that Claude Code session and say so. The hooks mark the worktree working again while Claude works and ready for review when it stops.
  3. Merge the branch, or push it and open a pull request, as in Run coding agents in parallel.
  4. Remove the worktree. Claude can't: neither the MCP server nor the skill offers it, so the folder stays until you act. Once the branch is merged the card is in Merged or gone with a "Remove worktree" button, or "Clean up" in the header removes every card in that column. From a terminal, pond remove agent/claude-code/fix-the-login-redirect does the same and refuses if anything isn't committed or pushed.

Codex

Codex has no plugins, so the same three parts are wired by hand. pond has to be on your PATH for this: Mergepond › Install Command Line Tool…, or the Homebrew cask.

  1. Run codex mcp add mergepond -- pond mcp.
  2. Copy the "Worktrees (Mergepond)" section of codex/AGENTS.md into your AGENTS.md, in the repository or in ~/.codex/AGENTS.md. It plays the part of the skill: ask once, start tasks with create_worktree, mark worktrees, never remove them.
  3. In ~/.codex/config.toml, set tool_timeout_sec = 600 for the mergepond server, so a long install finishes within one call, and add notify = ["pond", "hook", "codex"] at the top level. The notify line marks Codex's worktrees ready for review at the end of each turn. Coding agents: Codex has the exact file.

The first prompt, the worktree and the board then work as above, with "Codex" on the cards and agent/codex/… as the branch names.

Get more from it

  • Set Agent branch names in Worktree settings to something that sorts with your other branches, say ai/<task>. The pattern must keep <task>.
  • A repository that only you work in: pick "Only when I ask" and ask for a worktree when you want one. A repository where several agents run at once: "Always in a worktree".
  • Any agent that speaks MCP over stdio can use pond mcp, and any agent with a shell can run pond new --task "…" and pond mark review. See Other agents.
  • With Pro, Mergepond puts pond on the hosts it reaches over SSH, so an agent on a dev box can do all of this too.