/ca:using-git-worktreesfrom codeArbiter
Provides per-task filesystem isolation for parallel agent work using git worktrees. Opt-in only, prevents file collisions when multiple agents work concurrently.
Ships in codeArbiter. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
OPTIONAL. Per-task filesystem isolation for parallel agent work — opt-in only, never the default path.
Routed to by subagent-driven-development and dispatching-parallel-agents when, and only when, the
caller requests isolation. If no isolation is requested, this skill does not run; parallel units share
the working tree under their own discipline.
Isolation lets concurrent units edit files without collision. It changes
nothing about the gates — the consolidated work still clears commit-gate and the single
finishing-a-development-branch terminal step, run by the caller. What it MUST NOT do is multiply
that terminal step into one PR per unit.
Read these, or STOP and surface the gap — never guess:
${CLAUDE_PROJECT_DIR}/.codearbiter/CONTEXT.md — confirm the repo is a git repo and the base/working branch._resolve_workflow_pair with the trusted project root and pipeline slug rather
than reconstructing either path. For an HTML pair, load
${CLAUDE_PLUGIN_ROOT}/includes/artifacts.md and obtain
HTML task and path records only through the installed engine identity, index, and symbol-scoped read
operations. For a Markdown pair, use its existing Markdown task table. Worktree
planning must not create, convert, or consult a counterpart.Confirm the caller selected isolation within its current authorized scope AND supplied the parallel unit list from the exact selected plan. Absent either, do not stand up worktrees. A selected isolation method is not new authority to discard a branch or worktree.
Stand up one worktree per parallel unit. For each unit, create a worktree on a fresh branch off the
current base, under a dedicated parent directory outside the main working tree
(e.g. ../.codearbiter-worktrees/<slug>):
.codearbiter/.worktrees.json where that scratch manifest is already supported. Do not introduce a mandatory new schema to make ordinary isolation possible.Before provisioning, inventory dirty inputs relevant to each unit and record each path's SHA-256 or absence. A fresh worktree does not contain uncommitted caller bytes. If a dirty input overlaps a unit-owned path, stop: the unit cannot safely distinguish caller work from its own delta. Otherwise, reproduce it only as a read-only baseline, verify its hash before and after unit work, and exclude it from the unit index and commits. Recheck the caller copy is still byte-identical before fold-back. Preserve unrelated dirty paths by leaving them untouched.
Gate: every unit has a distinct worktree on a distinct branch, all rooted at the same verified base and recorded for resumption. Every relevant dirty input is either a content-addressed read-only baseline outside unit ownership or a named stop; unit commits exclude those baselines, and no cleaning, resetting, stashing or overwriting occurred.
Each parallel unit works entirely inside its own worktree. Dispatch is unchanged — the caller still dispatches its author and reviewer agents; they simply operate on the isolated path.
main or any other unit's branch.tdd — isolation is not a TDD bypass.Gate: each unit's work is contained to its own worktree, with no cross-worktree or base-branch writes.
Integrate each isolated unit's work back onto the caller's single working branch — do NOT finish each unit on its own. Per unit, in order:
main or the default branch.The consolidated working branch then takes the caller's normal single exit — ONE commit-gate pass
and ONE finishing-a-development-branch decision, run by the caller, not per unit. This skill
integrates; it never opens N PRs or finishes N branches. A unit that cannot integrate cleanly is
surfaced as a conflict for resolution — never force-merged, never dropped silently.
Gate: every accepted unit integrated onto the caller's working branch with conflicts resolved; no per-unit PR or finish was opened.
Record which worktrees and branches remain after fold-back. Integrated unit worktrees and branches
remain retained by default: they have no per-unit merged PR, so post-merge-cleanup cannot prove
them merged. This phase is their removal path only when all of the following hold: for a rebased unit,
the recorded tip was refreshed after rebase; the current recorded tip is an ancestor of the caller's
consolidated working branch after fold-back; the unit worktree is
clean with no unique untracked or stashed residue; and the existing explicit cleanup confirmation
names both its path and branch. Then remove that exact worktree with git worktree remove and delete
that exact branch with git branch -d; never use -D. If any proof or confirmation is absent, retain
the unit and its handoff entry. Continue to route cleanup of the consolidated PR branch itself through
post-merge-cleanup. Do not auto-delete an integrated, unaccepted or abandoned unit merely to close
this skill.
Gate: every remaining worktree is accounted for; no unreviewed work or user data is discarded.
main.finishing-a-development-branch per unit — integrate accepted units onto the caller's working branch, which takes the single commit-gate + finishing exit.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub arbiterforge/codearbiter --plugin ca22 skills in this plugin
/brainstormingRefine feature and sprint intent into a useful specification. Capture scope, observable criteria and material choices without repeated artifact approval ceremonies./commit-gateCreate a verified local Git commit when committing changes is requested. Not for explaining commit history, drafting a message only, or postponing a commit. Applies every commit gate and never implies a push or PR./context-checkInspect context drift and refresh selected source-backed documents under existing authorization./context-creationBuild source-backed project context through bounded inspection, optional agents, and record-level knowledge writes./crypto-complianceThe banned-primitive gate. Routed to when changed code hashes, signs, encrypts, derives keys, generates security-relevant randomness, configures TLS, or imports a crypto library. Rejects broken primitives, disabled TLS verification, and home-rolled crypto; the approved-primitive list lives in security-controls.md. The auth-crypto-reviewer agent is dispatched as the reviewer./debugInvestigate an unexplained defect or unexpected behavior without changing application code. Use for root-cause diagnosis and an evidence-backed handoff, including a bounded unresolved result. Not for implementing a known fix, new features, or explanation-only questions.Other plugins' skills for the same job