Using git worktrees
Skill Yco-0314/strata/skills/l3-execution/using-git-worktrees
Strata — a self-measuring skills framework for Claude Code & Codex: best-of-breed engineering skills stacked by altitude, where every skill has to prove it moves a measured number.
npx -y skills add Yco-0314/strata --skill using-git-worktreesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when starting feature work that needs isolation, or before executing implementation plans — creates an isolated git worktree with smart directory selection, ignore-safety verification, and a clean test baseline. Called by subagent-driven-development to bind isolation into the dispatch step.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.6 KB, 517 tokens by cl100k_base, as published. Nobody here has run it
Using git worktrees — L3 isolation primitive
Worktrees give each task/agent its own checkout sharing one repo, so parallel work can't collide. Announce: "Setting up an isolated worktree."
Directory selection (priority order)
.worktrees/exists → use it (wins overworktrees/).worktrees/exists → use it.grep -i "worktree.*director" CLAUDE.md→ use the stated preference, don't ask.- None → ask:
.worktrees/(project-local, hidden) or a global location.
Safety (project-local dirs only)
Verify the dir is git-ignored before creating anything:
git check-ignore -q .worktrees || git check-ignore -q worktrees
Not ignored? Add it to .gitignore, commit, then proceed — otherwise worktree contents
get tracked. (Global dirs outside the repo need no check.)
Create → setup → verify baseline
project=$(basename "$(git rev-parse --show-toplevel)")
git worktree add "$LOCATION/$BRANCH" -b "$BRANCH" && cd "$LOCATION/$BRANCH"
Then auto-detect setup (package.json→npm install, Cargo.toml→cargo build,
pyproject.toml→poetry install, go.mod→go mod download) and run the project's tests
to confirm a clean baseline. Tests fail at baseline → report and ask before proceeding (you
can't tell new bugs from pre-existing ones otherwise). Then report: path, test count, ready.
Worktree-bound fan-out (the borrow)
When a parent skill dispatches N parallel agents over independent domains, create N worktrees as part of the spawn step — one per agent — so isolation is an invariant of the fan-out, not a thing the caller must remember to pair. This fuses parallel-dispatch and isolation into one operation: parallel agents can never touch the same tree.
Windows / sandboxes: git worktree may need privilege — fall back to separate clones if
worktree add fails.
Red flags
Never create a project-local worktree without verifying it's ignored. Never skip the
baseline test. Never proceed past failing baseline tests without asking. Pairs with
finishing-a-development-branch (L4) for cleanup.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.