git-worktree-manager (gw)
CLI tool integrating git worktree with AI coding assistants. Single static binary (~1.9MB), instant startup (~3ms).
Successor to claude-worktree (Python).
Backward compatible: The
cwcommand is included as an alias. Existingcwworkflows,.cwshare, and.cwconfig.jsonfiles work unchanged.
Install
This installs both gw and cw binaries.
# Homebrew (macOS/Linux)
# cargo-binstall (pre-built binary, no compile)
# Direct download
# https://github.com/DaveDev42/git-worktree-manager/releases/latest
Quick Start
Commands
| Command | Description |
|---|---|
gw new <name> |
Create worktree + launch AI tool |
gw pr [branch] |
Create GitHub PR |
gw merge [branch] |
Rebase + merge + cleanup |
gw resume [branch] |
Resume AI session |
gw shell [branch] |
Open shell in worktree |
gw delete <target> |
Remove worktree |
gw list |
List all worktrees |
gw clean |
Batch cleanup (--merged, --older-than) |
gw status |
Show current worktree info |
gw tree |
Visual tree display |
gw stats |
Usage analytics |
gw diff <b1> <b2> |
Compare branches |
gw sync [branch] |
Rebase on base branch |
gw config ... |
Configuration management |
gw backup create/list/restore |
Git bundle backup |
gw stash save/list/apply |
Worktree-aware stash |
gw hook add/remove/list/... |
Lifecycle hooks |
gw export / gw import |
Config export/import |
gw doctor |
Health check |
gw scan |
Register repos for global mode |
gw -g <cmd> |
Global mode (cross-repo) |
Shell Integration
# bash/zsh
# fish
|
# Or use interactive setup
This enables gw-cd <branch> (and cw-cd alias) for quick worktree navigation.
Configuration
Config file: ~/.config/claude-worktree/config.json
License
BSD-3-Clause