In the AI Era, a Single Branch Isn't Enough — git worktree Pockode
Source: Dev.to
Background
In my last post I described building Pockode to control Claude Code on my home PC from my phone. After using it for a while, a new pain point became clear: parallel work.
The Problem with Parallel Work
When you’re using Claude Code, the waiting time starts to feel like a waste. While Claude Code is working on one feature, other ideas keep popping up:
- Push forward on another feature
- Investigate a bug
- Clear out the PR review backlog
When I wrote code by hand, I could simply work on one task at a time. With Claude Code, the urge to “have it do multiple things at once” comes naturally. Running multiple Claude Code instances that share the same working directory quickly leads to issues:
- Files generated by one task get overwritten by another
- Changes from one task break the assumptions of another
- State keeps shifting, making it hard to track what’s actually done
You can make it work with extreme care, but if parallel work is the norm, you need a more robust solution.
Introducing git worktree Management
To address this, I added git worktree management to Pockode. A few taps in the sidebar now let you:
- Create a new worktree for a separate task
- Switch between worktrees instantly
Pockode was designed mobile‑first, but the same workflow feels smooth on desktop as well. By focusing on making switching “as easy as possible” on mobile, the experience on a PC became the smoothest workflow I’ve had.
How It Works in Pockode
- Open the sidebar → tap “Add Worktree”.
- Choose a branch or create a new one.
- Pockode runs
git worktree addunder the hood, creating an isolated directory that shares the same repository objects. - Switch to the new worktree whenever you want to start a parallel task.
- When the task is done, you can delete the worktree from the same UI, which runs
git worktree remove.
Each worktree has its own working directory, so Claude Code instances no longer interfere with each other.
Benefits
- Isolation: Each task works in its own directory, preventing file overwrites.
- Speed: Switching worktrees is instantaneous, avoiding costly
git checkoutoperations. - Consistency: All worktrees share the same object database, keeping repository size low.
- Mobile‑friendly: The UI is optimized for a few taps, making parallel work feasible from a phone.
Conclusion
By integrating git worktree management, Pockode now supports true parallel development with Claude Code. You can keep multiple features, bug investigations, or PR reviews active without the chaos of shared state.