Git worktrees CLI with GitHub integration and Claude Code support.
npm install -g @onmax/wt- GitHub CLI (
gh) installed and authenticated - Claude Code (optional, for issue investigation)
- Git repository with a GitHub remote
Run wt in any git repository to start the interactive mode:
wtThe CLI guides you through creating worktrees from issues, PRs, or custom branches.
| Command | Description |
|---|---|
wt |
fzf picker → cd into worktree |
wt add [ref] |
Smart add (see examples below) |
wt add [ref] --pr |
Create worktree and open a draft PR |
wt ls |
List worktrees with PR/CI status |
wt rm [name] |
Remove worktree |
wt sync |
Rebase on base branch |
wt ci |
Show CI status for current PR |
wt add # interactive: pick issue/PR/custom
wt add fix-bug # new branch from default
wt add #123 # auto-detect: issue or PR
wt add @branch # clone existing remote branch
wt add fix-bug --pr # create draft PRWhen you run wt without arguments, the CLI presents an interactive menu:
- Create from Issue - Select an open GitHub issue, auto-generates branch name
- Create from PR - Clone an existing PR's branch as a worktree
- Create Custom - Enter a custom branch name
When creating from an issue, the CLI:
- Creates a worktree at
../{repo}-worktrees/{branch} - Copies
.envfrom the main repo if present - Pushes to your fork if you lack write access
- Launches Claude Code in plan mode to investigate the issue
Custom worktree paths can be configured per repository in ~/.config/wt/config.json:
{
"nuxt-hub/core": "~/nuxt/hub-worktrees",
"unjs/nitro": "~/nuxt/nitro-worktrees"
}The CLI uses git worktrees to maintain multiple working directories linked to a single repository. This approach:
- Eliminates the need to re-clone repositories
- Allows instant switching between branches via
cd - Shares fetched objects across all worktrees
- Enables working on multiple branches simultaneously
When you lack push access to a repository, the CLI automatically:
- Creates or uses your existing fork
- Adds the fork as a
forkremote - Pushes to the fork instead of origin
- Creates PRs with the correct
user:branchhead reference
MIT