Skill review

The using-git-worktrees skill, reviewed

From obra/superpowers. Kin scored it 78/100 and says: install it. Number 6 of 30 reviewed skills.

Reviewed on November 7, 2026. The skill may have changed since: read it on GitHub.

Kin, the Briefkin mascotA small dark card with two round eyes, brows, a mouth and an amber dot on its corner.

obra/superpowers · skills/using-git-worktrees/SKILL.md

B
78/100Good
Install it

using-git-worktrees

“Careful git worktree setup: checks first, asks first, then installs and tests. Mind the auto npm install.”

Post on X

What it does

Before feature work, it checks whether the agent is already in a worktree, asks before creating one, and prefers the harness's own worktree tool over git. It then installs dependencies and runs the tests to confirm a clean baseline.

When the agent uses it
When starting feature work that needs isolation from the current workspace, or before executing an implementation plan.
Who it is for
Good for anyone letting an agent build features on a branch. Skip it if you always work in place or don't want the agent installing dependencies on its own.
What it costs
112 lines, about 1.8k tokens once the agent loads it.
The description the agent sees

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback

What it tells the agent to do

  1. Compare git-dir with git-common-dir to see if you're already in a worktree, ruling out submodules
  2. In a normal checkout, ask the user before creating a worktree unless they already stated a preference
  3. Use a native worktree tool if one exists; otherwise run git worktree add in .worktrees/ or worktrees/
  4. Confirm the worktree directory is git-ignored; if not, add it to .gitignore and commit
  5. Detect the project type and install dependencies (npm, cargo, pip, poetry, go)
  6. Run the test suite for a clean baseline; ask if it fails, report ready if it passes

Lines worth reading

Straight from the file, with why each one matters.

  1. line 3Use when starting feature work that needs isolation from current workspace

    A clear trigger that leads with when to use it, though it never says 'branch' or 'git worktree' outright.

  2. line 12Never fight the harness.

    The core idea in four words: if the agent's platform manages worktrees, defer to it.

  3. line 55creates phantom state your harness can't see or manage

    The real reason to prefer native tools. Raw git worktrees leave state the harness can't see or clean up.

  4. line 86Add to .gitignore, commit the change, then proceed.

    A commit to your current branch, made without asking. Small, but a surprise.

  5. line 167proceeding past failures is your human partner's call

    Good line. Failing baseline tests go back to the human instead of being quietly ignored.

Watch out for

  • Medium

    Dependencies are installed without asking: npm install, pip and poetry download packages and can run install scripts.

    line 104Auto-detect and run appropriate setup:
  • Low

    If the worktree directory isn't ignored, the agent edits .gitignore and commits on your current branch without asking.

    line 86Add to .gitignore, commit the change, then proceed.
  • Low

    The ignore check passes if either directory is ignored, so the chosen one may not be. Its contents could then end up in commits.

    line 83git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

The scorecard

  • TriggerSays when to use it
    7/10

    Clear about when to use it, but never names 'git worktree' or 'branch' in the request wording

  • FocusOne clear job
    9/10

    One job, an isolated workspace, with setup and a baseline as natural follow-ons

  • LeanLight to load
    8/10

    168 lines; the quick reference repeats the steps, but it stays tight

  • ConcreteSteps you can follow
    8/10

    Real detection commands and fallbacks, but $LOCATION and $BRANCH_NAME are never defined

  • SafeSafe to run
    7/10

    Asks before creating a worktree, but installs dependencies and commits without asking

What it does well

  • Detects existing worktrees properly with git-dir vs git-common-dir, and guards against submodules giving a false positive
  • Prefers the harness's native worktree tool and explains why raw git worktrees cause trouble
  • Has a sandbox fallback: if git worktree add is denied, it says so and works in place

How it could be better

  1. Ask before installing dependencies

    Package installs touch the network and run third-party scripts, so the user should agree first.

    Add
    Before running any setup command, list what you plan to run (e.g. `npm install`) and ask the user to confirm. If they decline, skip to Step 3.
  2. Check that the chosen directory is ignored

    The current check passes if either directory is ignored, even when the one you picked isn't.

    Add
    git check-ignore -q "$LOCATION" || echo "$LOCATION is not ignored"
  3. Ask before committing the .gitignore change

    A commit on the user's current branch is a visible change they may not want.

    Add
    **If NOT ignored:** Tell the user, propose adding `<directory>/` to .gitignore, and commit only after they agree.
  4. Define LOCATION and BRANCH_NAME

    The create command relies on variables the skill never sets.

    Add
    LOCATION=<chosen worktree directory from Directory Selection>
    BRANCH_NAME=<short kebab-case name for the feature, confirmed with the user>

Kin reviews against Anthropic’s Extend Claude with skills and agentskills.io’s the Agent Skills standard. It reads SKILL.md only, so a script beside it can still do things the file does not say.

Thinking of installing another skill?

Link it or paste its SKILL.md and Kin reviews it the same way. Free, no sign-up.

Review a skill

More reviewed skills

Skills run while you look away.

Briefkin shows every Claude Code, Codex and Cursor session on one board: working, waiting on you, done. Answer them from your phone. Free in the open beta.

Make your board