Integrates finished worktree branches through one throwaway integration branch, testing after each merge and running the full suite before the main line moves, with exact rollback on failure. Not for creating worktrees; use worktree-create. Not for closeout; use branch-closeout.
Ships in worktree-merge. 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.
Integrate finished branches through a disposable integration branch. The target branch moves only after every branch integrates cleanly and the project's full validation suite passes; nothing reaches the main line broken.
See merge strategies for strategy mechanics (merge, squash, ff), rollback details, and protected base guards.
Arguments are passed in the user invocation message. Interpret them structurally from the prompt:
/skill:worktree-merge [--into branch] [--strategy merge|squash|ff] [--cleanup ask|keep] <branch...>
/skill:worktree-merge feat-a feat-b/skill:worktree-merge --into main --strategy squash feat/payments feat/invoicing/skill:worktree-merge --strategy ff --cleanup keep feat/docs-update<branch...>: Two or more branch names to integrate in order (or at least one when integrating into a distinct target branch).
git rev-parse --verify <branch>.--into <branch>: Target base branch receiving the merges.
<original>).--strategy <merge|squash|ff>: Git integration strategy.
merge (default): Uses git merge --no-ff <branch> to preserve commit topology.squash: Uses git merge --squash <branch>, followed by an atomic conventional commit.ff: Uses git merge --ff-only <branch>. Fails if the branch has diverged.--cleanup <ask|keep>: Post-integration scaffolding cleanup policy.
ask (default): Prompt the user via ask_user before removing worktrees or deleting branches.keep: Retain all source worktrees and branches after integration.<into> (or use --into <branch>).<into>. If dirty, STOP: commit or stash first.<into> is a protected or canonical default branch. In canonical-main-only repositories (a policy that project instructions such as CONTRIBUTING.md declare), maintainer integration is strictly local; never push integration or topic branches to the canonical remote.<branch...> with git rev-parse --verify <branch>. Any missing branch aborts the run before anything is created.Detect the project's test and validation suite per repository manifests and CI workflows (.github/workflows/*, Makefile, npm scripts):
Create a disposable integration branch off <into>:
git checkout -b integration-<first-branch> <into>
All integration and intermediate test runs occur exclusively on this branch.
For each branch in <branch...>:
--strategy:
merge: git merge --no-ff <branch>squash: git merge --squash <branch> && git commit -m "feat: squash <branch>"ff: git merge --ff-only <branch>git checkout <into> && git branch -D integration-<first-branch>
<into> remains untouched.<into>:
git checkout <into>
git merge --no-ff integration-<first-branch>
git branch -d integration-<first-branch>.If --cleanup ask is active, prompt the user via ask_user whether to clean up the merged branches and worktrees:
branch-closeout:
git worktree list --porcelain.git worktree remove (never rm -rf).git branch -d.--cleanup keep is active, leave worktrees and branches intact.Deliver a comprehensive completion report:
merge, squash, or ff)<into><into> without a disposable integration branch.--cleanup keep was passed or without confirmation.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/worktree-merge:worktree-mergefrom worktree-merge
npx claudepluginhub panstudio/pancode --plugin worktree-merge