git-worktrees

Create Git worktrees for isolated parallel Claude Code sessions.

194|26|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/jamesrochabrun/skills --skill git-worktrees-jamesrochabrun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktrees
Source: https://github.com/jamesrochabrun/skills/tree/main/skills/git-worktrees
Command: npx skills add https://github.com/jamesrochabrun/skills --skill git-worktrees-jamesrochabrun

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Git worktrees enable true parallel development across Claude Code sessions, isolated from main work, preventing conflicts and enabling faster iteration.

Core Features & Use Cases

  • Parallel Sessions: Run multiple Claude Code instances on separate branches.
  • Isolated States: Each worktree has its own file state.
  • Fast Context Switching: Switch tasks without stash/commit overhead.
  • Long-running Tasks: Maintain background work without blocking your main branch.
  • Lifecycle Operations: Create, list, cleanup, and sync worktrees.

Quick Start

Run scripts/create_worktree.sh to create a new worktree, then open Claude Code in the new directory and run /init to orient.

Frequently Asked Questions about git-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run multiple Claude Code sessions in parallel without conflicts?

Git worktrees create isolated branch environments so multiple Claude Code instances work simultaneously without conflicts. Each worktree maintains separate file state and branch context, letting you switch between tasks instantly without stashing or committing.

What's the best way to manage long-running refactors alongside active development?

Git worktrees let you maintain a dedicated worktree for long-running refactors on a separate branch while your main worktree stays unblocked. Background work continues in isolation, and you merge when ready without interrupting primary development.

How do I create and initialize a new Git worktree for Claude Code?

Run scripts/create_worktree.sh, which prompts for a feature name, validates your repository, creates a new branch, configures the worktree location, and opens a Claude Code session. Use /init in the new session to orient Claude with worktree context.

Can I use Git worktrees to handle hotfixes while keeping my main branch clean?

Yes. Create a worktree from your base branch for the hotfix, work in isolation without affecting main development, then merge back. This workflow prevents hotfixes from tangling with in-progress features on your primary branch.

What lifecycle operations does this Skill support for managing worktrees?

The Skill provides scripts and workflows to create, list, cleanup, and sync Git worktrees. After work completes, cleanup removes the worktree and branch; sync operations keep changes coordinated across parallel sessions.

Do I need prior Git knowledge to use parallel worktrees with Claude Code?

The Skill handles Git operations through automation scripts, but basic familiarity with branches and merging helps. The /init command orients Claude within your worktree so context transfer is seamless.