Skip to content

Git Worktrees Isolation

Sets up an isolated git workspace for feature work so the agent doesn't disturb your current branch.

Stars
310,931
Licence
MIT
Files
1 file

What it does

Before an AI agent starts coding a feature, this skill has it check whether it is already in a separate workspace. If not, it asks permission, then creates a separate copy of the project (a git worktree) on a new branch, so the main checkout stays untouched. It also installs dependencies and runs the test suite to confirm the new workspace starts clean.

Great for

  • Developers who let an AI agent implement features and want changes kept off their current branch
  • Teams using git branches who want each feature in its own folder
  • People running multi-step implementation plans that should start from a known-good state

Skip it if

  • Quick one-line edits or documentation tweaks where a separate workspace is unnecessary overhead
  • Projects that do not use git, since every step depends on git commands
  • Environments where you do not want the agent running install commands or test suites automatically, because Step 2 and Step 3 execute project scripts

Try asking

  • “Start a new feature branch for the login redesign in an isolated workspace”
  • “Set up a clean worktree before executing this implementation plan”
  • “Create an isolated workspace for the payments refactor and confirm the tests pass first”
Step-by-step guide: how to use Git Worktrees IsolationInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    using-git-worktrees.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip using-git-worktrees.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip using-git-worktrees.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Review the proposed worktree location and the .gitignore change before the agent commits anything, since it may add .worktrees/ to .gitignore and commit that change.
  • Decide your worktree directory preference in your instructions up front so the agent does not need to ask each time.
  • Check the dependency install and test commands for your project first, since they run automatically and may fetch packages from the internet.

What's inside

  • SKILL.md

Redistributed unmodified from obra/superpowers under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.