npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

git-worktree-toolbox

v0.5.1

Published

MCP server for managing git worktrees with synchronized branches. Provides tools for creating isolated development environments, tracking changes, and managing collaborative workflows.

Downloads

17

Readme

Git Worktree Toolbox

npm minzip package size

🌳 Git Worktree Toolbox is a MCP server and CLI for managing git worktrees.

Create isolated workspaces without the hassle of stashing changes and switching branches.

Ideal for AI-assisted development workflows requiring multiple features in parallel.

As a backup, use the gwtree command to run any of the mcp tools yourself.

Available MCP Tools (10)

  • list - List projects and their worktrees
  • new - Create a new worktree with a matching branch
  • archive - Archive worktrees and branches
  • go - Open worktree folder in your editor
  • changes - Review changes and optionally commit and push
  • grab - Pull in changes from a specific worktree
  • pr - Generate a link to create a pull/merge request
  • prompt - Resume AI agent sessions or setup AI agent auto-prompt (Claude/Cursor)
  • doctor - Fix worktree metadata issues
  • clean - Archive unused worktrees

Usage Examples

Once the MCP server is added, here's how you might phrase requests to activate each tool:

  • List worktrees: "List worktrees", "Show me all my projects and worktrees", "What worktrees do I have?"
  • Create new worktree: "New worktree for fixing the login bug", "Set up a new workspace for the user dashboard feature", "Make a worktree for the API refactor"
  • Archive worktree: "Archive this worktree", "Clean up the completed feature worktree", "Remove the old worktree and its branch"
  • Open worktree: "Open the login bug worktree in my editor", "Switch to the dashboard worktree", "Go to the API refactor workspace"
  • Review/Push changes: "Show changes from task-245", "What files have I modified?", "Push changes for task-245"
  • Grab changes: "Get login bug worktree changes", "Merge updates from the dashboard branch", "Pull in changes from the API worktree"
  • Create PR: "Generate a pull request link", "Create a merge request for task-245", "Make a PR for the current changes"
  • AI agent prompt: "Resume Claude session for task-245", "Setup Claude auto-prompt", "Setup Cursor Agent", "Continue conversation in this worktree"
  • Fix issues: "Fix my worktree metadata", "Repair worktree configuration", "Doctor the worktree setup"
  • Clean up: "Clean unused worktrees", "Archive old worktrees", "Remove completed worktrees"

Get Started

Add the MCP Server to Cursor / Claude Desktop:

{
  "mcpServers": {
    "git-worktree-toolbox": {
      "command": "npx",
      "args": ["-y", "git-worktree-toolbox@latest"]
    }
  }
}

The gwtree CLI is also available after a global installation:

npm install -g git-worktree-toolbox

Run gwtree help to see the available tools and their flags.

# List all projects with worktrees
gwtree list

# Create a new worktree with a matching branch
gwtree new "Fix login bug and flow"

# Archive current worktree (with branch removal)
gwtree archive -r

# Open current worktree and branch in editor
gwtree go

# Show the changes from all associated worktrees
gwtree changes

# Pull in changes from a specific worktree
gwtree grab fix-login-bug-1242

# Commit and push changes in a specific worktree
gwtree changes fix-login-bug-1242 -c

# Generate a link to create a pull/merge request
gwtree pr

# Fix worktree metadata issues
gwtree doctor

# Archive unused worktrees
gwtree clean

# Setup AI agent auto-prompt plugin (Claude by default)
gwtree prompt setup

# Setup with Cursor Agent instead
gwtree prompt setup --cursor

# Resume AI agent session for a worktree
gwtree prompt <worktree-id>

# Show help with advanced flag usage examples
gwtree help

AI Agent Prompt Plugin

When using the CLI, an interactive session with either Claude CLI or Cursor Agent can be automatically spawned in the new workspace, ready to use.

Quick Start

# 1. Setup AI agent plugin (one-time)
gwtree prompt setup              # Claude (default)
gwtree prompt setup --cursor     # Cursor Agent

# 2. Create worktree - AI agent auto-launches
gwtree new "Add user authentication"
# → AI agent starts with task context
# → Session ID saved in worktree metadata

# 3. Resume AI agent session later
gwtree prompt user-authentication-123
# → Continue conversation with full history

Features

  • Auto-launch: AI agent starts automatically with task context
  • Session persistence: Each worktree gets a unique session
  • Resume capability: Continue conversations anytime with gwtree prompt
  • Customizable prompts: Edit ~/.gwtree/ai-agent.yaml to customize templates
  • Switchable providers: Switch between Claude CLI and Cursor Agent
  • Optional: Disable globally or per-worktree

See src/plugins/claude-prompt/README.md and src/plugins/cursor-agent/ for more information.

Configuration

Optionally, configure the worktrees folder and project directories using environment variables:

# Storage directory for worktrees
# Default: ~/.gwtree/worktrees
export BASE_WORKTREES_PATH=~/my-custom-worktrees

# Custom project directories for discovery (colon-separated)
# Default: ~/Projects, ~/Code, ~/Developer
export PROJECT_DIRECTORIES="$HOME/custom-projects:$HOME/work"

Add these to your shell profile (~/.zshrc, ~/.bashrc, etc.) to persist across sessions.