# Worktree

> Use when user says "/worktree", asks to create a worktree, switch worktrees, list worktrees, check worktree status, or work on a GitHub issue in isolation.

- Skill: `tomevault-io/worktree-3` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/worktree-3`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/worktree-3/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/worktree-3

---


# Git Worktree Manager

Manage git worktrees with all worktrees stored in a sibling directory.

## Directory Convention

Given a repository at `/path/to/repo`, worktrees are stored at:
```
/path/to/repo.worktrees/<branch-name>/
```

## Modes

| Mode | Triggers | Description |
|------|----------|-------------|
| **Add** | `/worktree add <branch>`, `/worktree <branch>`, `/worktree #<issue>` | Create worktree |
| **Status** | `/worktree status` | Show PR/CI status table |
| **List** | `/worktree`, `/worktree list` | List and select worktrees |
| **Remove** | `/worktree remove <branch>`, `/worktree rm <branch>` | Remove worktree |
| **Prune** | `/worktree prune` | Clean stale references |

## Mode Detection

When this skill is invoked, arguments follow the skill name (e.g., `/worktree status` passes "status" as arguments).

**IMPORTANT:** Before doing anything else, identify the mode from the invocation arguments:

| Arguments | Mode | Instructions |
|-----------|------|--------------|
| (none) or `list` | List | Read `list.md` |
| `status` | Status | Read `status.md` |
| `#<number>` or just a number | Add (from issue) | Read `add.md` |
| `add <branch>` or just `<branch>` | Add (branch) | Read `add.md` |
| `remove <branch>` or `rm <branch>` | Remove | Read `remove.md` |
| `prune` | Prune | Read `prune.md` |

**First action:** Read the appropriate `.md` file for your detected mode, then follow those instructions exactly.

## Important Notes

1. Always use the sibling directory convention (`repo.worktrees/`)
2. Branch names can contain slashes (e.g., `feat/new-feature`)
3. **Run commands separately** - Don't use compound commands with `&&` or variable assignment

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/zeroae) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-16 -->

