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

@fnebenfuehr/worktree-cli

v1.5.0

Published

A modern CLI tool for managing git worktrees with ease

Readme

npm version license

Worktree CLI

Git worktree management for AI coding assistants. Enables parallel development across multiple branches without context switching.

Why?

AI coding assistants work best with isolated contexts. Git worktrees give each task its own directory—no stashing, no branch switching, no conflicts. Your AI can work on a feature while you review a PR in another worktree.

Quick Start

# Install
npm install -g @fnebenfuehr/worktree-cli

# Convert existing repo to worktree structure
cd your-project && worktree setup

# Create a feature worktree
worktree create feat/new-feature

See docs/QUICKSTART.md for detailed setup guide.

MCP Integration

Add to your Claude Code or AI assistant config:

{
  "mcpServers": {
    "worktree": {
      "command": "npx",
      "args": ["-y", "@fnebenfuehr/worktree-cli", "mcp"]
    }
  }
}

Your AI assistant can now:

  • Check worktree status before modifications
  • Create isolated worktrees for features/fixes
  • Switch between work contexts
  • Checkout PRs for review
  • Clean up merged branches

MCP Tools

| Tool | Description | |------|-------------| | worktree_status | Check if repo uses worktrees, current branch, default branch | | worktree_list | List all worktrees with branches and paths | | worktree_create | Create new worktree with branch | | worktree_checkout | Intelligent checkout: switch/create from local/remote | | worktree_pr | Checkout GitHub PR by number or URL | | worktree_switch | Switch to existing worktree | | worktree_remove | Remove worktree (with merge safety checks) | | worktree_setup | Convert repo to worktree structure |

CLI Commands

| Command | Description | |---------|-------------| | worktree clone <url> | Clone repo into worktree-ready structure | | worktree setup | Convert existing repo to worktrees | | worktree create <branch> | Create worktree and branch | | worktree checkout <branch> | Smart checkout: switch or create from local/remote | | worktree pr <number\|url> | Checkout PR branch | | worktree switch [branch] | Switch to worktree (interactive if no branch) | | worktree list | List all worktrees | | worktree remove <branch> | Remove worktree | | worktree update | Update CLI to latest version |

Configuration

Create .worktree.json in your repo root (auto-generated by setup/clone):

{
  "defaultBranch": "main",
  "post_create": ["npm install"],
  "pre_remove": ["docker compose down"],
  "copy_files": [".env", ".env.local"]
}

| Option | Description | |--------|-------------| | defaultBranch | Base branch for new worktrees | | post_create | Commands to run after creating worktree | | pre_remove | Commands to run before removing worktree | | post_remove | Commands to run after removing worktree | | copy_files | Files to copy from main worktree |

Hooks receive environment variables: WORKTREE_PATH, WORKTREE_BRANCH, WORKTREE_MAIN_PATH.

Comparison

| Task | Manual Git | Worktree CLI | |------|------------|--------------| | Create feature branch | git worktree add -b feat/x ../feat-x origin/main | worktree create feat/x | | Switch context | cd ../other-worktree | worktree switch other | | Setup new repo | Multiple commands + directory management | worktree clone <url> | | Post-create setup | Manual: install deps, copy .env | Automatic via hooks | | PR review | Stash → checkout → review → checkout → pop | worktree pr 123 | | AI integration | Manual git commands | Native MCP server |

Directory Structure

After setup, your repo looks like:

project/
├── main/           # default branch worktree
├── feat-auth/      # feature worktree
└── fix-bug/        # bugfix worktree

Each directory is a complete working copy with shared git history.

Documentation

License

MIT

Links