create-worktree

Create isolated git or jj worktrees with branch management and setup.

12|2|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/jeffh/claude-plugins --skill create-worktree
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-worktree
Source: https://github.com/jeffh/claude-plugins/tree/main/humanlayer/skills/create-worktree
Command: npx skills add https://github.com/jeffh/claude-plugins --skill create-worktree

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation of isolated development workspaces for feature development or bug fixes, enabling parallel work without polluting the main repository.

Core Features & Use Cases

  • Git worktrees / jj workspaces: Create a new git worktree (and branch) or a new jj workspace (and bookmark) with a single action.
  • Automated setup: Runs make setup to install dependencies in the new worktree.
  • Thoughts initialization (optional): Initialize thoughts directory if requested.
  • Environment cloning: Copy .claude directory into the new worktree if present.
  • Safe cleanup: Automatically cleans up failed setups and removes created worktrees/workspaces on demand.

Quick Start

Provide a worktree name (or allow automatic name generation) and a base branch; the tool will create the new worktree under $HOME/wt/[repo-name], copy configuration, install dependencies, and prompt you to start work in the new location.

Frequently Asked Questions about create-worktree

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

FAQPage Schema
How do I create a git worktree for feature development?

Git worktrees create isolated development workspaces by establishing a new branch and working directory. Provide a worktree name and base branch; the tool generates the path under $HOME/wt/[repo-name], sets up dependencies via make setup, and prepares the environment for parallel work without affecting your main repository.

Can I use worktrees with jj instead of git?

Yes, this Skill supports both git worktrees and jj workspaces. For jj, it creates a new workspace and bookmark instead of a branch, applying the same automated setup, dependency installation, and configuration cloning to establish an isolated development environment.

What happens if the worktree setup fails?

The Skill includes safe cleanup that automatically removes the created worktree or jj workspace if setup fails, preventing orphaned directories. This ensures your repository remains clean and you can retry without manual intervention.

How do I work on multiple branches concurrently without switching contexts?

Worktrees eliminate branch-switching overhead by maintaining separate working directories for each branch. Create a worktree for your feature or bug fix; dependencies install per-worktree, and your main checkout stays unaffected, enabling true parallel development.

Does the tool copy my project configuration into new worktrees?

Yes, the Skill clones your .claude directory into each new worktree and optionally initializes a thoughts directory. This environment cloning ensures per-worktree configurations and context are available without manual duplication.

When should I use worktrees instead of just switching branches?

Use worktrees when you need concurrent work on multiple branches, per-worktree dependencies, or isolated environments that don't disrupt your main checkout. Worktrees avoid the overhead of stashing changes and reinstalling dependencies each time you switch contexts.