using-git-worktrees Skill: Work on Features in an Isolated Worktree
Makes your agent do feature work in an isolated git worktree, so your current branch stays untouched.
- Installs
- 223.5K
- on skills.sh
- Stars
- 310.6K
- on GitHub
- Updated
- Oct 2026
- last repo commit
The skill works in four steps. It checks whether you are already in a worktree, asks your consent to create one, creates it with the agent's own worktree tool if there is one (or git worktree add if not), then runs project setup and the tests to confirm a clean start. If you decline, it works in place.
Without a native tool it uses .worktrees/ at the project root, or worktrees/ if that exists, and checks the folder is git-ignored first. If it is not, the skill adds it to .gitignore and commits that change. Setup commands such as npm install run automatically when the matching project file is found.
Good for
- Developers who run agents on features while keeping their main checkout clean
- Anyone about to execute an implementation plan on a risky change
Install using-git-worktrees
Claude Code
- 1
Copy this prompt.
Install the using-git-worktrees skill in Claude Code. Run this command: npx skills add https://github.com/obra/superpowers --skill using-git-worktrees Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
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
Sections in SKILL.md
- Overview
- Step 0: Detect Existing Isolation
- Step 1: Create Isolated Workspace
- 1a. Native Worktree Tools (preferred)
- 1b. Git Worktree Fallback
- Step 2: Project Setup
- Step 3: Verify Clean Baseline
- Report
- Quick Reference
- Common Rationalizations
Key facts
- Author
- obra (Superpowers)
- Installs on skills.sh
- 223,472 (Nov 2, 2026)
- Last repo commit
- Oct 29, 2026
- What installs
- One SKILL.md; no bundled scripts
What it includes
Checks git dirs and submodules to see if you are already in a linked worktree
If you are, it skips creating another. Otherwise it asks your consent.
Runs code ·
Step 0: Detect isolationUses the agent's own worktree tool when one exists, such as EnterWorktree
Preferred so the client can manage placement, branches and cleanup.
Runs code ·
Step 1a: Native worktree toolFallback: creates the worktree in .worktrees/ after checking it is git-ignored
Adds the folder to .gitignore and commits if it was not ignored. If a sandbox blocks it, it works in place.
Runs code ·
Step 1b: git worktree addRuns npm install, cargo build, pip or poetry install, or go mod download as detected
Based on package.json, Cargo.toml, requirements.txt, pyproject.toml or go.mod.
Runs code ·
Step 2: Project setupRuns the tests; reports failures and asks whether to continue
A dirty baseline makes later failures ambiguous.
Runs code ·
Step 3: Verify clean baseline
From the official docs
Permissions
Medium risk
The skill runs git and package installs, which can execute third-party code, and may commit a .gitignore change. Use it on projects you trust.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It runs package installs on its own
npm install, cargo build, pip install or go mod download run when the matching file exists. This executes third-party code, so use it on projects you trust.
It may edit .gitignore and commit
This happens only when the worktree folder is not already ignored. Check the commit.
Technical details
| Talks to | Package registries during setup |
|---|
Questions
What does using-git-worktrees do?
It sets up an isolated git worktree before feature work, then installs dependencies and runs the tests so you start from a known state.
How do I install it in Claude Code, the Claude app or Codex?
Use the install box above for this skill alone. The Superpowers README also lists plugin installs for Claude Code, Codex and Cursor.
Does it need an API key?
SKILL.md mentions none. It runs git and your project's own setup and test commands.
Is it safe?
It bundles no scripts. It does run git and package installs in your repo and may commit a .gitignore change, so check the commands it asks to run.
Will it create a worktree without asking?
No. It asks for consent unless you already stated a preference in your instructions. If you decline it works in place.
How does it end the work?
This SKILL.md does not cover finishing. The finishing-a-development-branch skill from the same repo covers merging, opening a PR and worktree cleanup, and this skill does not call it.
Information
updated Nov 2, 2026
- Repository
- obra/superpowers
- Folder
skills/using-git-worktrees
Sources
Docs, issue trackers and discussions this page is built from.
Show all 3Hide
- obra/superpowers using-git-worktrees SKILL.md · github.com
- obra/superpowers README · github.com
- finishing-a-development-branch SKILL.md · github.com