git-worktree

vkkotha's avatarfrom vkkotha

Create isolated git worktrees for reviewing PRs, branches, tags, or commits without affecting main working directory.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 3, 2026

When & Why to Use This Skill

The Git Worktree skill for Claude enables developers to create isolated working environments for reviewing pull requests, branches, tags, or specific commits. By leveraging Git's native worktree functionality, it allows for seamless context switching and parallel development without disturbing the main working directory or requiring complex stashing workflows.

Use Cases

  • Efficient PR Reviews: Quickly spin up a dedicated directory to checkout and test a colleague's pull request while keeping your current work-in-progress active and untouched in the main directory.
  • Isolated Bug Reproduction: Switch to a specific historical commit or tag in a separate worktree to reproduce and debug reported issues without losing your current development state.
  • Parallel Feature Development: Manage multiple active branches simultaneously across different IDE instances (VS Code, JetBrains, or Claude CLI) to work on a feature and a hotfix at the same time.
  • Clean Environment Testing: Run builds or automated tests in a fresh worktree to ensure that local, uncommitted files in your primary workspace are not interfering with the results.
name"git-worktree"
description"Create isolated git worktrees for reviewing PRs, branches, tags, or commits without affecting main working directory."

Git Worktree

Scripts

Setup: "${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/setup-worktree.sh" --pr|--branch|--tag|--commit <VALUE> Options: --editor skip | --editor-cmd <code|idea|claude>

Open main: "${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/open-main-worktree.sh"

Cleanup: "${CLAUDE_PLUGIN_ROOT}/skills/git-worktree/cleanup-worktree.sh" --pr|--branch <VALUE> Options: --yes or -y (skip confirmation)

Behavior

  • Location: ../<project>.worktrees/<folder-name>
  • IDE auto-detection: VS Code, JetBrains, or Claude CLI
  • Branch handling: local branches used directly, remote → worktree-branch-<name>, PRs → worktree-pr-<number>, tags/commits → detached HEAD
  • Windows: prefix with bash (requires Git Bash)