/worktree-ops:pull-worktree [--from <branch>] [--merge]from worktree-ops
Pull the latest changes from a base branch into the current worktree — fetch, then rebase (or merge) this worktree's branch onto the newest origin/main (or any branch you name), guiding conflict resolution. Use when the user says a worktree/branch is "behind", wants to "pull in the latest", "catch up", "update", "sync", or "rebase onto main/develop" a worktree before continuing or opening a PR. The base to pull from is configurable, unlike anything native.
Ships in worktree-ops. 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.
None: SKILL.md is the whole skill.
Bring the current worktree's branch up to date with a base branch. "Pull" here means integrate the base branch INTO this worktree (not git pull of the branch's own upstream). Run it from inside the worktree.
At any step, if a required input is missing or the safe path is ambiguous, stop and use AskUserQuestion before acting — don't assume a default that rewrites history. Confirm when unclear:
--from is absent and the default base can't be resolved, ask;Run the helper — it reports state and never changes history:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/wt-pull-preflight.sh" [--from <branch>]
It prints branch=, inprogress=, dirty=, source=, fetched=, ahead=, behind= (plus any note=). Act on it:
inprogress set (exit code 3) → a rebase/merge is already underway; don't start another. Help finish it (resolve per §3) or abort (git rebase --abort / git merge --abort), then stop.dirty > 0 → don't integrate onto a dirty tree. Offer (via AskUserQuestion) to stash → integrate → pop, or commit/abort. If stashing, do all three; if the final git stash pop conflicts, resolve it under the §3 policy and don't drop the stash until clean.behind = 0 → already up to date; report and stop.source as the base.Default to rebase (linear history on a feature branch):
git rebase <source>
Use merge instead (git merge <source>) when --merge is passed, or the branch is already pushed and shared. If unclear, ask with AskUserQuestion.
A rebase replays commits one at a time, so conflicts can recur. List them deterministically (complete set + hunks):
bash "${CLAUDE_PLUGIN_ROOT}/scripts/wt-conflicts.sh"
Repeat until the rebase finishes: review the reported conflicts, resolve, git add each, git rebase --continue (or commit, for a merge).
Resolution policy — defer to the user unless it is obvious and safe. Resolve a conflict yourself ONLY when the result is unambiguous and low-risk:
For anything else — overlapping edits to the same logic, deletion vs. edit, or any unclear intent — stop and ask with AskUserQuestion, showing the file and the "ours" vs. "theirs" hunks and the choices (keep ours / keep theirs / combine / I'll describe). Never assume which side is correct; when in doubt, treat it as ambiguous and ask.
Enforced, not just requested: while this skill is active, its
PreToolUseguard blocks anygit commit/--continuewhile unresolved conflicts or leftover conflict markers remain, so a partial or guessed resolution cannot be committed.git rebase --abort/git merge --abortis always the clean escape hatch.
State the new ahead/behind. A rebase rewrites history, so if the branch was already pushed it needs git push --force-with-lease — offer to do that push now so it isn't a forgotten step. Mention /worktree-ops:list-worktrees to confirm.
What SKILL.md sets; muted values are Claude Code's defaults
sonnethighBash${CLAUDE_PLUGIN_ROOT}/hooks/guard.shOther plugins' skills for the same job
4 skills in this plugin
/create-worktreeCreate an isolated git worktree for a new task and switch this session straight into it — no restart, no manual cd. Branches fresh from the latest origin base, copies gitignored env files (.worktreeinclude), runs an optional per-project setup script, and can seed from a GitHub issue or PR. Use when the user wants to "create/start/spin up a worktree", "work on this in a separate branch/checkout", kick off isolated/parallel work for a feature or bugfix, or start a task from an issue or PR without disturbing the current checkout./list-worktreesShow a dashboard of every git worktree in this repo — branch, commits ahead/behind the base branch, uncommitted (dirty) file count, and open-PR status — with the current session's worktree marked, so all parallel sessions are visible at a glance. Use when the user asks to "list worktrees", "worktree status", "what worktrees do I have", "show my parallel sessions", "which branches am I working on", or wants an overview of in-flight worktree work before pulling, switching, or merging./merge-worktreeFinish a worktree — commit any remaining work, push, open or update its pull request, optionally merge into a target branch once checks are green, run an optional teardown script, then remove the worktree and switch this session back to the main checkout. Use when the user says a task is "done", wants to "finish", "wrap up", "ship", "merge", "merge and clean up", or "tear down" a worktree, or to close out parallel work and reclaim the checkout. The merge target is configurable; pairs with create-worktree.npx claudepluginhub zakattack9/agentic-coding --plugin worktree-ops