/git-flow:using-git-worktreesfrom git-flow
Creates and removes isolated git worktrees for parallel development. Use when working on multiple branches simultaneously or cleaning up a specific worktree after its PR merges.
Ships in git-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A worktree gives parallel work its own folder and branch while the main worktree stays clean on the integration branch. Each project gets one sibling root, <project>.worktrees/, with one directory per branch named by its slug (/ → -, so feature/auth → feature-auth). Remove the worktree and branch after the PR merges.
A plain branch switch with no parallel work needs no worktree: check git status --short, then git switch <branch>. Trivial solo one-liners may also stay in the main worktree.
Check git status --short and git worktree list first. Leave uncommitted changes where they are and never stash them silently; pass --allow-dirty only when the user has authorized isolating new work while keeping them.
scripts/setup-worktree.sh <branch> [--base <ref>] [--allow-dirty] [--setup] [--test]
The script runs git worktree add from the main worktree root. It checks out an existing local or origin branch instead of recreating it, and refuses an existing path, a branch checked out in another worktree, or a dirty tree without --allow-dirty. It reports base divergence from local refs without fetching.
--setup does a frozen install with the declared package manager and lockfile (uv for Python). Conflicting lockfiles or manager declarations stop it. A setup failure exits non-zero but still prints the path.--test runs the detected baseline tests. Failures only warn.scripts/cleanup-worktree.sh [branch]
A cleanup request authorizes removal of a clean, verified merged worktree and its branch without another confirmation. The script fetches first and verifies Git ancestry, a merged PR bound to the repository/base/head, or an equivalent squash patch without gh. It preserves new commits and uncommitted files, including ignored files. For an exception, show the exact target, full tip OID, commits and files at risk, then ask once. After consent, recheck the tip and files and run --force <branch> yourself; never require the user to copy and run the command. Main, protected, and locked worktrees remain guarded even with force. For bulk or stale cleanup and command-local hook consent, use cleanup-git. Leave git pull out of cleanup; update the integration worktree separately only when clean and requested.
For cases the scripts refuse or don't cover, read workflow.md.
WORKTREE READY | WORKTREE REMOVED | BLOCKED
Branch: <branch>
Path: <project>.worktrees/<slug>
Next: cd <path>, or the script's refusal reason
Report cleanup as done only after verifying the worktree and branch are gone. Name the merge proof or the explicitly approved exception.
What SKILL.md sets; muted values are Claude Code's defaults
3 skills in this plugin
/cleanup-gitRemove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "delete merged branches", "gone branches", or wants to clean local git state. NOT for creating commits, creating worktrees, or configuring git hooks./configuring-git-hygieneConfigure safe git workflow hygiene: pre-commit/pre-push hooks, Gitleaks secret scanning, .gitignore rules, local git config, and guardrails. Use when setting up git hooks, gitleaks/git leaks, staged pre-commit checks, pre-push validation, core.hooksPath, .gitignore, or git config best practices. NOT for creating commits (use committing-code), cleaning branches/worktrees (use cleanup-git), or creating worktrees (use using-git-worktrees).npx claudepluginhub alexei-led/cc-thingz --plugin git-flowOther plugins' skills for the same job