Command Palette

Search for a command to run...

Назад к скиллам
скилл № 97858

Worktree

Manage git worktrees for parallel work: create, enter existing, status, cleanup, audit, review kept (use ExitWorktree keep to leave if…

БесплатноЗапускает вложенные скрипты
melodic-softwareот melodic-software★ 34 звезды на GitHub

Установить Worktree в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Worktree

Arguments. [create|status|cleanup|audit|review] [args]. e.g., /worktree create feat/my-feature, /worktree status, /worktree cleanup [<path>...] [--dry-run], /worktree audit, /worktree review

Repository context. Gather first

Run each command below as its own Bash call, all sent together in one message (worktree isolation). Keep any bound in the command's own pipe (output limits). Unless this section says otherwise, treat a failure (not a repository, git unavailable) as an unknown value and carry on. Keep these as body calls, never ## Pre-computed context lines (gather-block convention).

  • Current branch, git branch --show-current
  • Worktree inventory, git worktree list | head -30
  • Git dir. git rev-parse --git-dir
  • Git common dir (differs from the git dir when in a linked worktree). git rev-parse --git-common-dir

Body calls keep this skill invocable from inside a worktree. The Bash shapes an isolated session accepts at body time and in subagents are in reference/gather-block.md, "Accepted command shapes for body-time and subagent Bash".

The refusal that record names is documented isolation enforcement, so the constraint is durable. Our rules: treat a refused compound command as unverifiable, not as proof it would have reached the main checkout; rewrite it as plain, separate commands; expect a delegated worker to inherit the same refusal; and never use PowerShell, whose coverage is narrower, as a route around the git-redirect or command-shape check. Pointer: How Claude Code enforces isolation, which lists the checks, their scope over subagents and background runs, and PowerShell's coverage.

Purpose

Orchestrate git worktree lifecycle from creation through cleanup. Front-half of the development workflow: it gets you into a worktree and keeps worktrees healthy. /source-control:pull-request is the back-half: prep, PR creation, monitoring, merge.

Why this exists: worktrees isolate parallel code changes, so Claude Code sessions on different tasks don't step on each other. Where branch protection blocks direct commits to main, every feature, fix, or refactor starts with a worktree or branch; this skill makes that seamless.

This skill canonically owns the parallel-session worktree convention for this plugin fleet, and reference/nesting-invariant.md § The nesting invariant, dated measurement is the one site that states the mechanism; every other surface in this plugin points there. That is an ownership claim, not a census: consumer docs outside this repository also describe worktree placement, at least one written after that file's as-of date. So ownership comes with an inbound channel: a consumer that measures something contradicting that file should open an issue on this plugin's tracker so the owner is corrected here. Without that back-channel the owner is the last to know.

Worktrees live at an external worktree_root (<root>/<owner>-<repo>-<slug>, outside every repository), defaulting to <plugin-data-dir>/worktrees when the key is unset, and never nested inside any repository's tree. Creation enforces that nesting invariant on the dated measured basis recorded below, not as a standing absolute. Keeping worktree_root clear of repository-discovery roots (such as a ghq root) is convention, not machine-checked: creation rejects only paths inside an existing repository, so a root inside a discovery tree still pollutes repository enumeration (ghq list reports each worktree as a repository, and a leading dot does not hide it). Choose a configured root accordingly. The default is already clear: the plugin data directory is harness state, never a checkout and never inside a discovery tree, which a checkout-relative default would be under a layout like <root>/github.com/<owner>/<repo>.

Adapting to your environment (graceful degrade)

This skill is self-contained: every action runs on plain git, plus the forge CLI for PR cross-referencing where available (GitHub provider reference). An adjacent capability it mentions (an issue tracker, a build/lint verifier, a session-start setup hook) is optional: use it when present, proceed without it otherwise. Project conventions (branch naming, worktree layout, which gitignored files a fresh worktree needs) come from the consuming project's own CLAUDE.md,

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • context/audit.md
  • context/cleanup.md
  • context/create.md
  • context/review.md
  • context/status.md
  • evals/evals.json
  • nesting-invariant-ssot.test.sh
  • reattach-slice.test.sh
  • reference/gather-block.md
  • reference/native-worktree.md
  • reference/nesting-invariant.md

FAQ

Что делает скилл Worktree?

Manage git worktrees for parallel work: create, enter existing, status, cleanup, audit, review kept (use ExitWorktree keep to leave if EnterWorktree/ExitWorktree resolves in this session). Use on main before editing: 'create worktree', 'worktree status', 'clean up worktrees', 'orphaned worktrees'. Not for PRs: /source-control:pull-request.

Как установить скилл Worktree?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Worktree запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить Worktree с