Skip to main content
GWTree enables you to run multiple AI coding agents in parallel, each working on separate branches in isolated worktrees. This means zero conflicts, no context switching, and faster feature delivery.

Why Parallel Agents?

In the AI-assisted development era, you can leverage multiple coding agents simultaneously:
  • Claude Code fixing authentication bugs
  • Command Code building API endpoints
  • Cursor creating UI components
Each agent works in its own isolated environment without stepping on each other’s toes.

Quick Start

1

Create multiple worktrees instantly

Create three worktrees for different features in one command:
This creates:
  • repo-auth/ with auth branch
  • repo-api/ with api branch
  • repo-dashboard/ with dashboard branch
The -x flag skips opening editors automatically.
2

Launch agents in each worktree

Open each worktree with its dedicated agent:
3

Work in parallel

Each agent now operates independently:
  • No branch switching conflicts
  • No stash/unstash cycles
  • No context loss between tasks
  • Each agent maintains its own state
4

Monitor progress

Check status across all worktrees:
This shows changes, commits ahead/behind, and merge status for each worktree.

Real-World Workflow

Bug Fixes

Assign critical bugs to different agents:
Each agent can investigate and fix independently.

Feature Development

Split a large feature across multiple agents:
Coordinate full-stack development in parallel.

Testing Approaches

Try different implementations simultaneously:
Compare solutions before committing.

Refactoring Tasks

Tackle refactoring modules in parallel:
Keep refactoring isolated from new features.

Merging Work

Once an agent completes its work:
This automatically:
  1. Checks out main
  2. Merges the auth branch
  3. Removes the repo-auth/ worktree
  4. Deletes the auth branch

Best Practices

Assign tasks to agents that don’t overlap in the same files. This prevents merge conflicts and allows true parallel work.
Name worktrees clearly to track which agent is working on what:
Use gwt status frequently to track progress across all agents:
Remove merged worktrees regularly:

Advanced: Fast Mode

For even faster setup, use -y to skip all prompts:
This uses saved defaults and creates all worktrees instantly.

Troubleshooting

If two agents need to work on overlapping code:
  1. Let one agent complete and merge first
  2. Update main: cd repo && git pull
  3. Rebase the other agent’s work: cd repo-feature && git rebase main
Ensure you’re in a git repository and have a clean working directory:

Next Steps

Feature Development

Learn the complete feature development workflow with worktrees.

Code Review

Review PRs without disrupting your current work.