How to run Claude Code, Codex, and OpenCode sessions in parallel with Git worktrees (from your phone)
A practical workflow to isolate tasks into worktrees, run Claude Code/Codex/OpenCode sessions in parallel, and review/commit safely from your phone — from one place.
- CLI
- 0.1.0
- Preview ref
- 5433faf
The thing that made worktrees finally click for me wasn’t “I can check out two branches.”
It was multi-agent work.
When you run two sessions in the same folder, the failure modes are predictable:
- agents touch the same files
- diffs get tangled
- you lose the thread on what belongs to which task
A simple rule fixes most of it:
one worktree per task
Then, if you want to:
- run one Claude Code session on a refactor
- run a Codex session on tests
- run an OpenCode session on docs
…you can do it in parallel without stepping on yourself.
This guide is the workflow I use.
Quick definition: what a worktree is (and why it helps with agents)
Git’s own docs describe a worktree as a way to manage multiple working trees attached to the same repository, letting you check out more than one branch at a time. (Source: https://git-scm.com/docs/git-worktree)
For multi-agent work, the important part is simpler:
- each worktree is an isolated folder
- each agent gets its own folder
So “which agent changed this file?” becomes a directory question, not a detective story.
What I tried first (and where it fell apart)
- One branch, one folder, run agents sequentially: safe, but slow.
- One folder, multiple agents: fast, but messy.
- Stash/unstash between tasks: workable, but error-prone when you do it often.
Worktrees were the first thing that felt both fast and safe.
A workflow that worked for me
I ended up using Happier as the control plane for this.
It gives you two things in one place:
- Sessions: launch/monitor Claude Code, Codex, OpenCode sessions
- Projects: manage folders/repos (Files + Source control) outside sessions
Trade-off: your computer still has to be online.
If you’re new to Happier (what it is, and where to get it)
If you haven’t seen Happier before: it’s an open-source companion app (mobile/web/desktop) that lets you run sessions on a computer you trust, then manage them from your phone.
Get set up:
- GitHub: https://github.com/happier-dev/happier
- Install/download: https://github.com/happier-dev/happier#how-it-works
- Discord: https://discord.gg/W6Pb8KuHfg
The pattern: one worktree per task
Here’s the simplest version:
- create a worktree for task A
- create a worktree for task B
- run one session in each
- review/commit each worktree separately
If you only take one thing from this guide, take that.
Step-by-step
1) Pick the tasks you actually want in parallel
Parallelism is a tool.
Good parallel tasks:
- tests vs docs
- refactor vs small UI tweak
- fix bug vs write migration plan
Bad parallel tasks:
- two agents editing the same core file set
2) Create worktrees
In raw Git, you’d use git worktree add ... to create linked worktrees. (Source: https://git-scm.com/docs/git-worktree)
In practice, what matters is the result:
- two folders, each with its own branch checked out
3) Add each worktree folder as a Project
In Happier:
- add each worktree folder under Projects
This gives you a per-worktree Source control view (diffs/commit/push) that doesn’t mix changes.
4) Launch a new session in the right worktree
Now the key step you mentioned:
- you can launch a new Claude/Codex/OpenCode session from the worktree context
The habit that keeps things clean:
- name the session after the worktree/task
- keep the session scoped (“only touch files in this worktree”)
5) Monitor sessions from one place
Once multiple sessions are running, the goal is not to read every transcript.
It’s to:
- see which sessions are active
- handle approvals
- send one follow-up
Then, when something is done:
- switch to Projects → Source control
- review the diff
- commit/push
6) Review and commit per worktree
Your safety rule:
- never commit cross-worktree changes in one commit
If you do, you’ve lost the benefit of isolation.
Terminal (optional)
In Projects, you also have a fully-featured terminal accessible on the terminal icon in the project page header (on the right).
I use it for one-off commands (grep, quick status), not as my primary workflow.
FAQ
Why not just use branches without worktrees?
Because switching branches in a single folder forces you into stash/WIP patterns.
Worktrees let you keep work in place.
Do I need one agent per worktree?
Not always.
But if you’re running agents in parallel, one agent per worktree is the easiest way to prevent collisions.
What’s the biggest mistake?
Creating worktrees… and then still running multiple agents in the same folder.
Isolation only works if you actually use it.
What should I name my worktrees and sessions?
I try to make names self-explanatory on a phone screen.
- worktree:
hotfix-<ticket>/docs-<topic>/tests-<area> - session: match the worktree name, plus the agent (e.g. “hotfix-123 (Codex)”)
How many parallel sessions is “too many”?
For me, it’s not about raw count — it’s about whether I can still review safely.
A good default is 2–3 parallel sessions:
- one doing the main change
- one doing a secondary task (tests/docs)
- optionally one doing a review/check
How do I keep agents from touching the wrong worktree?
Two habits help a lot:
- Put the worktree name in the first message: “You are working in
<worktree-name>only.” - Ask for a checkpoint summary after the first couple steps.
If you’re away from your keyboard, it’s worth being explicit.
What’s the “phone loop” when multiple sessions are running?
My loop is:
- open Happier
- check which sessions are active
- handle approvals
- send one short follow-up (or “stop and summarize”)
- when a session is done, review its worktree diff and commit
The goal is to stay in control without trying to do deep coding on a phone.
How do I review each agent’s work safely?
Treat each worktree as its own review/commit unit.
- Source control → Changed files → ↓ Review
- commit with a narrow message
- push only when you’re confident
What if two agents need to touch the same file?
At that point, parallelism is less helpful.
Options:
- sequence the work (agent A then agent B)
- split tasks so they touch different parts of the codebase
- or let one agent do the change and the other do review
Is this only useful from a phone?
No — but it’s especially useful from a phone.
Worktrees keep the filesystem tidy.
Happier makes it possible to monitor sessions and review/commit from the same place whether you’re on mobile, desktop, or web.