# create-worktree-skill

Creates a separate Git worktree for a chosen branch and prepares its ports and configuration. Use it to run multiple project branches side by side.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · ★ 1556
- Author: disler
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/disler/claude-code-hooks-multi-agent-observability/tree/HEAD/.claude/skills/create-worktree-skill/SKILL.md
- Updated: 2026-02-08
- HTML: https://affpapa.org/en/nevibecode/skills/create-worktree-skill

## What it does

The `create-worktree-skill` skill sets up a Git worktree under `trees/<branch-name>`. Each environment has its own ports, database, and configuration, allowing several project instances to run at the same time. Port assignments are calculated automatically, with an optional manual offset.

To build the environment, the skill invokes `/create_worktree_prompt <branch-name> [port-offset]`. The command prepares environment files, installs server and client dependencies, and starts both services. Its output includes access URLs and instructions for managing the new worktree.

A branch name is required. If you leave it out, the skill asks you to provide one. Dependency installation requires `bun`. An existing worktree for the same branch or uncommitted Git changes can prevent setup from completing.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add disler/claude-code-hooks-multi-agent-observability --skill create-worktree-skill -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/create-worktree-skill/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/create-worktree-skill/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add disler/claude-code-hooks-multi-agent-observability --skill create-worktree-skill -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/create-worktree-skill/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add disler/claude-code-hooks-multi-agent-observability --skill create-worktree-skill -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/create-worktree-skill/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install disler/claude-code-hooks-multi-agent-observability create-worktree-skill
```

2. **Manually: put the files in place**
- File: `.github/skills/create-worktree-skill/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add disler/claude-code-hooks-multi-agent-observability --skill create-worktree-skill -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/disler/claude-code-hooks-multi-agent-observability --path .claude/skills/create-worktree-skill
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/create-worktree-skill/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add disler/claude-code-hooks-multi-agent-observability --skill create-worktree-skill -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/disler/claude-code-hooks-multi-agent-observability/tree/HEAD/.claude/skills/create-worktree-skill/SKILL.md

## When to use it
- Create a dedicated worktree for a feature branch
- Run multiple branches of one project at once
- Assign separate ports to parallel application instances
- Prepare an isolated environment for testing a fix
- Install dependencies and launch the client and server in a new worktree

## Example prompts
- Create a separate worktree for the `feature-dashboard` branch.
- Set up the `hotfix-security` branch with a port offset of `5`.
- Create separate worktrees for `feature-a`, `feature-b`, and `feature-c`.

## Similar
- [triage](https://affpapa.org/en/nevibecode/skills/triage.md) — skill · 990453 installs
- [code-review](https://affpapa.org/en/nevibecode/skills/code-review.md) — skill · 789521 installs
- [implement](https://affpapa.org/en/nevibecode/skills/implement.md) — skill · 774700 installs
- [git-guardrails-claude-code](https://affpapa.org/en/nevibecode/skills/git-guardrails-claude-code.md) — skill · 499069 installs
- [setup-pre-commit](https://affpapa.org/en/nevibecode/skills/setup-pre-commit.md) — skill · 489289 installs
- [scaffold-exercises](https://affpapa.org/en/nevibecode/skills/scaffold-exercises.md) — skill · 480196 installs

From the same set: [disler/claude-code-hooks-multi-agent-observability](https://affpapa.org/en/nevibecode/by/disler/claude-code-hooks-multi-agent-observability.md) — 4 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
