gwtree
v2.0.0
Published
Git worktree manager for parallel development
Readme

GWTree
Git worktree manager for parallel development
Create and manage git worktrees effortlessly. Run multiple AI agents in parallel — Claude Code, Command Code, Cursor on separate branches simultaneously.
Installation
npm install -g gwtreeUsage
Multi-Agent Parallel Execution
gwt auth api dashboard -x # Create 3 worktrees instantly, no editor popupsSpin up isolated worktrees for multiple AI agents to work in parallel:
- Claude Code →
repo-auth/fixing authentication - Command Code →
repo-api/building API endpoints - Cursor →
repo-dashboard/creating UI components
Each agent works on its own branch without conflicts. Merge when ready with gwt merge.
Create Worktree
gwt # Interactive mode
gwt feature-login # Quick: creates repo-feature-login worktree with feature-login branch
gwt feature-login -y # Fast: skip all prompts, use saved defaults
gwt auth api dashboard # Batch: create multiple worktrees at once
gwt a b c -x # Batch + skip editor opensInteractive prompts guide you through:
- Name — Enter name for both worktree and branch (press ESC to set separately)
- Stash/Switch — Handle uncommitted changes and switch to main
- Pull — Fetch latest changes from remote
The CLI shows each command as it runs with full transparency.
List & Remove Worktrees
gwt ls # List all worktrees for current repo
gwt rm # Interactive search and removeStatus Dashboard
gwt status # Show status of all worktrees
gwt st # AliasShows for each worktree: changes, commits ahead/behind, merge status.
Clean Merged Worktrees
gwt clean # Remove worktrees that have been merged to main
gwt clean --all # Remove all worktreesMerge & Cleanup
gwt merge feature # Merge branch to main, remove worktree, delete branchAutomates: checkout main, merge, remove worktree, delete branch.
Features
Batch creation
Create multiple worktrees at once: gwt dashboard api auth
Status dashboard See changes, commits ahead/behind, merge status for all worktrees
Smart cleanup
Auto-remove merged worktrees, or clean all with --all
Merge helper One command to merge, remove worktree, and delete branch
Quick worktree creation Minimal prompts, smart defaults, transparent command output
Smart naming
Pattern: {repo}-{name} with matching branch name
Interactive management List, search, and delete worktrees
Clean UX Compact output with └ brackets, ESC for separate worktree/branch names
Configuration
Manage defaults with gwt config or gwt config reset.
Settings stored in ~/.config/gwtree/config.json:
- editor —
code,cursor,default, ornone - installDeps — Auto-install dependencies (true/false)
- lastPm — Last used package manager
Commands
| Command | Alias | Description |
|---------|-------|-------------|
| gwt | gwtree | Create new worktree (interactive) |
| gwt [name] | — | Create worktree + branch with name |
| gwt a b c | — | Batch create multiple worktrees |
| gwt [name] -y | — | Fast mode, skip all prompts |
| gwt [name] -x | --no-editor | Skip opening editor |
| gwt ls | list | List worktrees for current repo |
| gwt rm | remove | Interactive search and remove |
| gwt status | st | Show status of all worktrees |
| gwt clean | c | Remove merged worktrees |
| gwt clean -a | --all | Remove all worktrees |
| gwt merge <name> | m | Merge branch to main and cleanup |
| gwt config | — | Open config file |
| gwt config reset | — | Reset to defaults |
| gwt -v | --version | Show version |
| gwt -h | --help | Show help |
Why GWTree?
Built for the AI-assisted development era:
- Multi-agent parallelism — Run Claude Code, Command Code, Cursor on separate features simultaneously
- Instant worktree creation —
gwt a b c -xcreates 3 isolated environments in seconds - Clean merges — Each agent works on its own branch, merge when ready
- Zero conflicts — No stashing, no branch switching, no context loss
MIT License by Ahmad Awais.
