Back to Skills

creating-git-worktree

verified

Creates isolated git worktree environments for parallel development. Fetches latest from default branch, creates worktree in .git-worktrees/, copies .env and .serena files. Branch '/' is converted to '-'. Use when starting new features or switching context.

View on GitHub

Marketplace

my-marketplace

kkhys/claude-code-marketplace

Plugin

base

Repository

kkhys/claude-code-marketplace
1stars

plugins/base/skills/creating-git-worktree/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/kkhys/claude-code-marketplace/blob/main/plugins/base/skills/creating-git-worktree/SKILL.md -a claude-code --skill creating-git-worktree

Installation paths:

Claude
.claude/skills/creating-git-worktree/
Powered by add-skill CLI

Instructions

# Create Git Worktree Environment

Automate worktree creation with environment setup for parallel development workflows.

## Quick Start

Execute the script with your branch name:

```bash
bash skills/creating-git-worktree/scripts/create-worktree.sh <branch-name>
```

**Example**:
```bash
bash skills/creating-git-worktree/scripts/create-worktree.sh feature/user-auth
# Creates: .git-worktrees/feature-user-auth
```

## What the Script Does

1. **Sync with remote**: Checkout and pull default branch
2. **Create worktree**: In `.git-worktrees/<branch-name>` (new or existing branch)
3. **Copy environment files**: `.env`, `.serena` if they exist
4. **Reuse existing**: Skip creation if worktree already exists

## Branch Name Handling

- `/` is converted to `-` for directory names
- `feature/new-feature` becomes `.git-worktrees/feature-new-feature`

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
842 chars