worktree-isolation — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited worktree-isolation (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Every /team pipeline run operates in one or more isolated git worktrees — one per repository the topic touches. The worktree boundary is at the router level — not per-agent. This means:
/team runs can execute simultaneouslywithout file conflicts. Each gets its own worktree(s).
is never polluted by in-progress implementation, test scaffolding, or intermediate commits.
in whatever directory the orchestrator hands them.
+ backend + shared types) by listing them in docs/plans/<id>/repos.md. The router creates a worktree in each, branched off the same <id>.
When docs/plans/<id>/repos.md is absent, the topic touches only the home repo (the repo the user invoked /team from). The router creates exactly one worktree using Claude Code's native worktree support:
<repo>/.claude/worktrees/<id><id>, branched from the default remote branch (origin/HEAD)No custom worktree creation, path management, or teardown logic is needed.
When docs/plans/<id>/repos.md is present, the topic spans multiple repos. The router creates one worktree per listed repo, all sharing the same branch name <id>:
<repo-path> in repos.md:<repo-path>/.claude/worktrees/<id><id>, branched from that repo's origin/HEADgit -C <repo-path> worktree add .claude/worktrees/<id> -b <id> origin/HEADdocs/plans/<id>/artifact directory. The other repos' worktrees do not duplicate the artifacts; agents that need them read from the home worktree's path, which the orchestrator passes in.
After all worktrees are created, the orchestrator appends a ## Worktrees section to repos.md recording the per-repo worktree paths. Any later /team-* invocation rediscovers them by reading that one file.
For the home repo, Claude Code has built-in worktree support (--worktree <topic> or dispatch into a worktree context). For additional repos in multi-repo mode, the router uses plain git worktree add because Claude Code's native flag only knows about the repo it was launched from. Either mechanism produces a standard git worktree — there is no behavioral difference downstream.
The home worktree is created at the leading WORKTREE phase — phase 1 of 8, before QUESTION (see Why first below for the rationale). The router's responsibilities are:
<id> off origin/HEAD,and author docs/plans/<id>/ inside it — no copy is ever needed because the artifact directory is born in the worktree. (Secondary repos in multi-repo mode get their worktrees after the design gate, once repos.md confirms the repo set; same <id> branch in each.)
appropriate worktree (the home worktree by default; per-repo worktrees when a slice or step carries a [repo: <name>] annotation). The durable inter-agent protocol is the artifact files under the home worktree's docs/plans/<id>/ directory; live coordination uses TodoWrite (session-scoped).
If the session is already running inside a linked worktree — any working tree other than the repository's main working tree, detected by the checkout's git dir differing from its common git dir — on a non-default branch, the WORKTREE phase reuses it instead of creating a new one: no new branch, no artifact copy — work continues in place on the current branch. If that worktree is checked out on the default branch (main/master), the phase refuses and stops — implementing directly on the default branch is never acceptable, and nesting worktrees is not supported. See "Detect existing worktree" in skills/team-worktree/SKILL.md for the procedure.
Worktree creation is the leading phase — it runs first, before QUESTION — for two load-bearing reasons.
First, authoring docs/plans/<id>/ inside the worktree from phase 1 keeps the home checkout's git status clean for the entire run. No intermediate artifacts, test scaffolding, or commits ever touch the main working tree.
Second, a leading worktree gives the recovery hooks a genuine first state to detect: "a worktree exists for <id>, no task.md yet" ⇒ WORKTREE. The phase becomes inferable from the moment the run begins rather than only appearing midway through the pipeline.
For design-gate ergonomics, the orchestrator prints the absolute worktree-rooted `design.md` path when presenting the design, so the reviewer opens the file cleanly without hunting for the worktree — this supersedes the old "review on the home tree" rationale.
Together these make leading placement a deliberate, articulable choice.
All agents — researcher, planner, test-architect, implementer, reviewers — run inside whichever worktree the orchestrator hands them for the current slice or step. In single-repo mode that is always the home worktree. In multi-repo mode the implementer changes directory between repos as the plan steps require, committing each slice in the worktree where its files live. Main working trees are never touched.
Opening a PR does not tear down the worktree — the user may need to iterate on the branch (push follow-up commits, address review feedback). Keep the worktree until the PR is merged or the user explicitly asks to remove it. The same holds when commits are kept locally without a PR.
When teardown is warranted (post-merge or on explicit request):
or rebase commits onto the target branch in that repo, then let Claude Code (or git worktree remove) remove the worktree.
<worktree-path> and git -C <repo-path> branch -D <id>`.
with the merge: git -C <repo-path> pull --rebase origin <base>. Always rebase — never a merge commit — so history stays linear.
rm -rf docs/plans/<id>.These are untracked QRSPI scratch that only existed to drive the work to a merged PR; deleting them is part of teardown, alongside the branch and worktree. Verify the directory is untracked first (git ls-files docs/plans/<id> returns nothing) and remove only that feature's <id> directory — never sibling dirs for other in-flight work.
Git worktrees are fresh checkouts — they don't include untracked files like .env or .env.local. To copy these automatically, add a .worktreeinclude file to the project root using .gitignore syntax:
.env
.env.localOnly files matching a pattern that are also gitignored get copied. In multi-repo mode, each repo honors its own .worktreeinclude independently.
If worktree creation fails in any repo (shallow clones, certain CI systems):
Falling back to main tree for that repo."
repo's portion of the work runs in its main working tree.
in-place work for the entire pipeline — no isolation, but the pipeline still runs.
Never block the pipeline because worktree creation failed — isolation is a best-practice enhancement, not a hard requirement.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.