Gives AI agents the power to spin up isolated git worktrees on demand. Work on multiple features in parallel, each with its own branch, without stash and branch-switching chaos.
Each task runs in its own sandbox—experiment, so you can break things or pivot strategies—while your main branch stays pristine. Built for AI-assisted workflows where rapid iteration and context switching are the norm.
Discovery & Navigation
list
- List projects and their worktreesgo
- Open worktree folder in your editor
Worktree Lifecycle
new
- Create a new worktree with a matching branchchanges
- Show changes and optionally commit and pusharchive
- Archive worktree and matching branchdoctor
- Check and fix worktree metadata
Integration
mr
- Supply the MR/PR creation linkgrab
- Merge changes from another worktree
Use the gwtree
CLI to run tools directly:
# Create a new worktree
gwtree create -d "Fix login bug" -b login-fix
# Archive a worktree (with branch removal)
gwtree archive -i task-abc123 -r
# Open worktree in editor
gwtree go -i task-abc123 -e cursor
# Show changes and commit/push
gwtree changes -i task-abc123
# Commit/push the changes
gwtree changes -i task-abc123 -c
# Merge changes from another worktree
gwtree grab -i feature-branch -f
# Generate MR link
gwtree mr -i task-abc123
# List all projects
gwtree list
# Check worktree health
gwtree doctor
# Show help
gwtree --help
# Show version
gwtree --version
Positional arguments: The first string flag can be provided without the flag name:
gwtree create "Fix login bug" # Same as: gwtree create -d "Fix login bug"
Two installation options for this package:
Option 1: Use with npx (recommended)
- No installation required
- Version auto updates
{
"mcpServers": {
"git-worktree-toolbox": {
"command": "npx",
"args": ["-y", "git-worktree-toolbox@latest"]
}
}
}
Option 2: Install Globally
- Locally installed and run
- No version auto updates
npm install -g git-worktree-toolbox
{
"mcpServers": {
"git-worktree-toolbox": {
"command": "gwtree"
}
}
}
Set custom project directories for the list projects
tool (optional):
# Custom project directories (colon-separated)
# Default: ~/Projects:~/Code:~/Developer:~/dev
PROJECT_DIRECTORIES=~/custom-projects:~/work:~/repos
Run the dev server and inspect the MCP connection:
npm run dev
npm run inspect
STDIO (stdin/stdout) was chosen over HTTP/SSE and WebSocket transports for several key reasons:
Security - Process-level isolation. No exposed ports, no authentication layers, no CORS concerns. Communication stays within the local machine.
Simplicity - Zero infrastructure required. No web servers, proxies, or network configuration. Just a command that spawns a process.
Native MCP Support - Claude Desktop and Cursor natively support STDIO transport out-of-the-box. No additional tooling or adapters needed.