Inter-office memo
- To
- Everyone running coding agents in worktrees
- From
- Mo, Chief Executive
- Date
- November 26, 2026, 5:41 PM CST
- Re
- Merging a worktree into main
How to merge a Claude Code or Codex worktree into main in 2026: 9 ways compared
As of November 26, 2026, commit in the worktree, run “git merge” with its branch from your main checkout, then “git worktree remove”; Worktrunk’s free “wt merge” does it in one command. For a review first, open a pull request, which Claude Code’s desktop app, Conductor, Orca and T3 Code do with a button. Codex hands a chat back to your checkout, and Enjoy’s Merge into has the agent merge and settle conflicts.
Disclosure: Enjoy is our product, and it has a merge button of its own. We checked every way below against its maker’s own pages on November 26, 2026, and we say where another way is the better pick, including the free ones that don’t need Enjoy.
The ways to merge a worktree, compared
A worktree is, in Claude Code’s words, “a separate checkout on its own branch.” That’s what lets several agents work at once without touching each other’s files, and it’s also why their work isn’t in main until someone merges that branch. Most agent apps make the worktree for you. Far fewer bring it back, and the ones that do mostly hand the job to a pull request on GitHub.
| Way | Best for | Price, checked November 26, 2026 | How it merges | Runs on |
|---|---|---|---|---|
| Plain Git | Any agent, any repository, nothing to install | Free and open source | You run git merge or a rebase from your main checkout |
Mac, Windows, Linux |
| A pull request on GitHub | Review and checks before anything reaches main | Auto-merge in private repositories needs GitHub Pro, Team or Enterprise | Push the branch, gh pr create, merge on GitHub |
Anywhere Git and the GitHub CLI run |
| Worktrunk | One command that merges and cleans up | Free, MIT or Apache 2.0 | wt merge: squash, rebase, fast-forward, remove the worktree |
Mac, Linux, Windows |
| Claude Code | Claude users who want a pull request watched to the end | Included in Claude Pro ($20 a month), Max ($100), Ultra ($200), Team and Enterprise | No local merge; Merge when ready in the desktop app, or /ship |
Terminal on Mac, Windows, Linux; desktop app on Mac, Windows, Linux in beta |
| Codex in the ChatGPT app | Bringing a background chat into your own checkout | In every ChatGPT plan from Free; Plus $20 a month, Pro from $100 | Hand off to Local, or Create branch here and open a pull request | Mac, Windows, Linux |
| Conductor | Mac users who merge through reviewed pull requests | No prices listed | Create PR, then merge when it’s approved and green, then archive | Mac |
| Orca | A free app with an AI button for conflicts | Free, MIT | Push, open a review, merge or auto-merge on GitHub | Mac, Windows, Linux |
| T3 Code | A free app that commits, pushes and opens the pull request in one button | Free, MIT | One-button pull request; agents can merge it | Mac, Windows, Linux |
| Enjoy | A local merge where the agent settles the conflicts, for every lab’s agent | A monthly subscription, free for 7 days (pricing) | Merge into your project: the worktree’s agent merges into your main folder | Mac, Windows, Linux |
Prices are per month as each maker lists them, before tax. Except for Claude Code and Codex, which come with their labs’ plans, none of these includes an AI plan: your agents run on your own Claude, ChatGPT or other plans, which those companies bill for separately.
Plain Git
Best for: anyone, with any agent, who wants the work in main now.
Commit in the worktree, then go to your main checkout, where main is, and merge the worktree’s branch. You can’t do it from inside the worktree, because, as OpenAI’s Codex docs put it, “Git only allows a branch to be checked out in one place at a time,” and your main folder already has main. For a worktree Claude Code made, the branch is worktree-<name>:
git merge worktree-feature-auth
git worktree remove .claude/worktrees/feature-auth
git branch -d worktree-feature-auth
For a straight history, run git rebase main in the worktree first, then git merge --ff-only worktree-feature-auth from the main checkout. “With --ff-only, resolve the merge as a fast-forward when possible. When not possible, refuse to merge and exit with a non-zero status,” Git’s merge docs say, so nothing lands half-done.
Price: free. Git is free and open source.
Watch for: “Only clean worktrees (no untracked files and no modification in tracked files) can be removed. Unclean worktrees or ones with submodules can be removed with --force.” Forcing it deletes whatever the agent hadn’t committed, so check git status in the worktree first. And you sequence the merges yourself: when two agents changed the same lines, the second merge stops for you to resolve.
A pull request on GitHub
Best for: teams, and anyone who wants review and checks to pass before main changes.
Push the worktree’s branch and open a pull request with GitHub’s CLI. gh pr create will “Create a pull request on GitHub,” and “When the current branch isn’t fully pushed to a git remote, a prompt will ask where to push the branch and offer an option to fork the base repository.” Then gh pr merge with --squash will “Squash the commits into one commit and merge it into the base branch,” and with --auto, “Automatically merge only after necessary requirements are met.” Remove the worktree afterward the way plain Git does. Claude Code’s desktop app, Conductor, Orca and T3 Code all end with a pull request too, with buttons for these steps.
Price: GitHub’s docs say “Auto-merge for pull requests is available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.”
Watch for: auto-merge “must be enabled for the repository” first, and “Auto-merge is disabled if someone without write permissions pushes new changes to the head branch or switches the base branch.” The merge happens on GitHub, so your main checkout needs a git pull before the next agent starts from it.
Worktrunk
Best for: people who want plain Git’s local merge as one command.
Worktrunk “is a CLI for git worktree management, designed for running AI agents in parallel.” Its wt merge does what you’d otherwise type by hand: “Merge a branch into the target branch. Squash & rebase, fast-forward the target branch, remove the worktree.” It’s “Similar to clicking “Merge pull request” on GitHub, but locally,” runs your hooks before the merge, and backs up anything it sweeps into the squash. Install it with brew install worktrunk && wt config shell install on a Mac or Linux, cargo install worktrunk, or winget install max-sixty.worktrunk on Windows.
Price: free, under the MIT or Apache 2.0 license.
Watch for: “wt merge merges into the local target branch and never fetches,” so pull main first. “Non-fast-forward merges are rejected,” and “A rebase conflict is left in the source worktree to resolve or abort.” It’s a command, not an app, so you still run each agent yourself.
Claude Code
Best for: Claude users who’d rather hand the merge to a pull request Claude watches.
Start Claude Code with claude --worktree feature-auth, and its worktree “is created under .claude/worktrees/<name>/ at your repository root, on a new branch named worktree-<name>.” Its docs cover the end of the session, not the merge: “When you exit an interactive worktree session, Claude checks the worktree for work that removal would delete,” and when there is some, “Claude prompts you to keep or remove the worktree.” Keep it and merge with plain Git, or ask Claude to “create a pr for my changes.” The /ship command opens the pull request, reviews it and works on “failing checks, merge conflicts, reviewers’ comments,” and then: “once the pull request is ready, merge it yourself.” In Claude’s desktop app, turn on Worktree before a session. Once its pull request is open, Merge when ready “turns on GitHub’s auto-merge for the PR. In a local session, Desktop requests a squash merge unless the base branch uses a merge queue,” and Auto-archive after PR merge or close clears the session away.
Price: “Claude Code is included in all paid plans,” by Claude’s pricing: Pro at $20 a month, or $17 billed yearly, Max at $100, Ultra at $200, Team and Enterprise.
Watch for: at the exit prompt, “Removing deletes the worktree directory and its branch, along with all the work in them.” “Non-interactive runs with -p have no exit prompt, so Claude doesn’t clean up their worktrees.” In the desktop app, “In SSH and WSL sessions: Merge when ready is disabled,” and pull requests need the GitHub CLI installed and signed in.
Codex in the ChatGPT app
Best for: Codex users who want a background chat’s work in their own checkout.
In the ChatGPT desktop app, where Codex runs on your computer, worktrees “let Codex run multiple independent chats in the same project without interfering with each other.” “By default, Codex works in a detached HEAD state,” so there’s no branch to merge until you choose a way back. To bring the chat into the foreground, “select Hand off in the chat header and move it to Local,” and “Codex handles the Git steps required to move the chat safely between the worktree and your local checkout.” To keep it on the worktree instead, use Create branch here: “From here you can commit your changes, push your branch to your remote repository, and open a pull request on GitHub.”
Price: “ChatGPT Work and Codex are included in your ChatGPT Free, Go, Plus, Pro, Business, Edu, or Enterprise plan,” says its pricing. Plus is $20 a month, and Pro starts at $100.
Watch for: “Remember, if you create a branch on a worktree, you can’t check it out in any other worktree, including your local checkout.” Files your .gitignore lists “won’t move with the chat unless Codex copies them into a local managed worktree with .worktreeinclude.” And “By default, Codex keeps your most recent 15 Codex-managed worktrees,” though before it deletes one, it “saves a snapshot of the work on it.”
Conductor
Best for: Mac users who run several agents and merge through reviewed pull requests.
Conductor runs Claude Code, Codex, Cursor and OpenCode in workspaces of their own, and “When the work is ready, Conductor helps you review the diff, open a pull request, merge, and archive the workspace.” Its workflow is “Create a pull request with Command + Shift + P,” and its review guide says to “Merge when the PR is approved, checks are green, comments are handled, and todos are complete. After merge, archive the workspace so it leaves your active work list.” For conflicts: “If the branch has conflicts, ask an agent to help resolve them, then rerun tests and review the diff again before continuing.”
Price: Conductor lists no prices on its site.
Watch for: “Conductor is not available for Windows or Linux yet,” says its installation page, and “A branch can only be checked out in one workspace at a time.” Its docs describe merging through pull requests, not a local merge.
Orca
Best for: a free app that takes a worktree from commit to merged, with an AI button for conflicts.
Orca, from Stably AI, gives each agent its own worktree, and its commit and push docs take it from there: “After the branch is pushed, use the Source Control panel’s hosted review action to create the pull request or merge request.” Its GitHub page says the merge button “offers Enable auto-merge so GitHub merges the branch automatically once its requirements (checks, required reviews) pass.” When a merge or rebase leaves conflicts, “Source Control shows Resolve with AI next to Review conflicts so you can either hand the conflict set to an agent or inspect it yourself before continuing.” Then “Deleting a worktree removes both the directory and the branch (with confirmation).”
Price: “Free and open source,” under the MIT license, on macOS, Windows and Linux.
Watch for: it doesn’t document a local merge into main, and “The auto-merge control is hidden for PRs GitHub reports as draft, closed, conflicting, or unstable, and for repos that don’t allow auto-merge.” When the branch is behind, “Orca will not silently force-push.”
T3 Code
Best for: a free, open-source app where one button turns a worktree into a pull request.
T3 Code says: “Each thread can work in its own worktree. Review the diff, then commit, push, and open a pull request with one button.” Its source control docs add that “Agents can read, open, update, comment on, and merge PRs in the thread’s repo using your configured sign-in (refusing merges if the head moved since last read),” and it works with GitHub, GitLab, Bitbucket, Azure DevOps and others.
Price: free, under the MIT license, on Mac, Windows and Linux.
Watch for: “Git push and clone still require Git SSH/HTTPS credentials on the server, separate from API tokens.” Like Orca, it merges on the host, not locally. And cleaning up old worktrees is up to you unless you turn it on: “Enable automatic cleanup in Settings → Worktrees → Cleanup (off by default; runs on startup, on change, and hourly).”
Enjoy
Best for: merging locally, for every lab’s agent, with the agent working out the conflicts.
In Enjoy, an agent makes a worktree when you ask, such as “Try a dark mode in a new worktree,” and the conversation carries on in it with everything it already knew. When you like the result, select Merge into your project’s name on the band above the message box. Enjoy sends the worktree’s agent a message to merge into your main folder, and “The agent handles commits and conflicts, and asks about anything it can’t decide.” It works the same for Claude Code, Codex, Grok Build, Antigravity, Muse Code and OpenCode, on Mac, Windows and Linux, and in the web app.
Price: a monthly subscription, and the first seven days are free. See pricing.
Watch for: Enjoy isn’t open source, and it’s a subscription on top of your AI plans. The merge is a message to the agent, so it runs on that agent’s plan, and the agent may stop first, for example when your main folder has changes that aren’t committed, until you say what to do with them. “The worktree stays after merging,” and Delete worktree gives “no warning first.” The iPhone app has no merge button: you ask in a message, and your phone, other computers and teammates need Enjoy Cloud. It merges locally; for a pull request, you ask the agent for one.
When to stay with what you have
If your team already merges through pull requests, keep doing it: review, checks and a record of who changed what are worth the extra step, and Claude Code’s desktop app, Orca, T3 Code and Conductor all make that step a button. If you merge one branch now and then, plain Git is enough, and Worktrunk is the free upgrade when you’re doing it ten times a day. If you only use Codex, Hand off already does the Git work for you.
Look further when you want one way to merge that works for every lab’s agent, a local merge where the agent deals with the conflicts, or merging from your phone.
How we compared
We read each maker’s docs, pricing and installation pages on November 26, 2026, and every one is linked below. We quote their own words for each limit, and we don’t count a feature a maker hasn’t documented: where a page says nothing about merging, we say it merges through a pull request or not at all. This category changes weekly, so we recheck this guide against its sources at least once a month, and the date at the foot of the page says when we last did.
13.Questions.
How do I merge a worktree into main?
- Commit in the worktree, then go to your main checkout, where main is checked out, and run “git merge” with the worktree’s branch. Then remove it with “git worktree remove” and delete the branch with “git branch -d”. You merge from the main checkout because Git won’t check out one branch in two worktrees.
Does Claude Code merge its worktree for me?
- No. Claude Code’s worktree docs cover keeping or removing the worktree when you exit, not merging it. Its /ship command opens and watches a pull request, then says “once the pull request is ready, merge it yourself,” and the desktop app’s Merge when ready turns on GitHub’s auto-merge.
How do I get Codex’s worktree changes into my local checkout?
- In the ChatGPT desktop app, select Hand off in the chat header and move the chat to Local, and Codex does the Git steps. Or select Create branch here, then commit, push and open a pull request. Files your .gitignore lists don’t move unless a .worktreeinclude file copies them.
Will deleting a worktree lose my changes?
- It can. Plain Git removes only clean worktrees unless you add “--force”. Claude Code asks before removing a worktree with work in it, and Codex saves a snapshot before it deletes one of its own. Orca deletes the folder and branch after asking, and Enjoy’s Delete worktree gives no warning.
How do I avoid merge conflicts between parallel agents?
- Merge one worktree at a time, and rebase the next onto the new main before it lands. Worktrunk rebases before every merge, Orca has Resolve with AI for conflicts, Conductor tells you to ask an agent to help resolve them, and Enjoy’s merge has the agent work them out and ask about anything it can’t decide.
Do I need GitHub to merge a worktree?
- No. Plain Git, Worktrunk and Enjoy merge on your computer. The pull request ways need a host such as GitHub, and GitHub’s auto-merge works in private repositories only on GitHub Pro, Team or Enterprise.