worktree

Manage git worktrees with automatic port assignment for parallel development sessions.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/ryan-lingle/claude-worktrees --skill worktree-ryan-lingle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/ryan-lingle/claude-worktrees/tree/main
Command: npx skills add https://github.com/ryan-lingle/claude-worktrees --skill worktree-ryan-lingle

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bundler, yarn, redis, and includes scripts (resource) components.

What problem does it solve?

Git worktrees allow running multiple isolated development contexts against the same repository by giving each task its own working directory while sharing history. This skill manages creation, tracking, and port allocation to enable parallel Claude Code sessions with non-conflicting dev servers.

Core Features & Use Cases

  • Create and list per-worktree spaces with automatic port assignment
  • Enforce absolute paths for cross-session usage and reliable file state operations
  • Provide a Rails-oriented setup workflow and port-aware configuration to simplify local development
  • Handle setup and teardown of worktrees in a safe, reversible manner
  • Support quick switching between worktrees for feature development and bug fixes
  • Preserve per-worktree environment isolation (ports, .worktree-port, and .env.native)

Quick Start

Run /worktree create <name> to create a new worktree with an auto-assigned port and then run the setup script to initialize it.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I run parallel Claude Code sessions without file state conflicts?

Git worktrees provide isolated working directories for parallel development sessions by giving each task its own file state while sharing repository history. This enables multiple Claude Code sessions to run concurrently without conflicts.

How do I set up a new git worktree with automatic port allocation?

Run the worktree create command with a name argument to generate a new worktree with an auto-assigned port. Then execute the setup script to initialize the isolated environment and prepare it for native development.

Can I use git worktrees for local Rails app development?

Yes, this worktree management approach applies to local Rails apps and other repos. It provides a Rails-oriented setup workflow with per-worktree port tracking and environment isolation to simplify local development.

Do I need Redis and Bundler to manage worktrees with port allocation?

Yes, managing worktrees with this setup workflow requires Bundler, Yarn, and Redis as dependencies. These tools support the per-worktree environment isolation and port-aware configuration for native development.

What is the best way to isolate dev server ports across multiple worktrees?

Per-worktree port tracking enforces automatic port assignment for each isolated working directory. This prevents dev server conflicts when running parallel development sessions concurrently using separate worktrees.