Switching branches repeatedly can interrupt unfinished changes. Git worktrees provide separate checkout directories attached to one repository. This skill prepares that isolation and establishes whether the new environment is ready for development.
Install and start
Run the following plugin command inside a Claude Code session to install Superpowers, including its cooperating skills. In Codex, find Superpowers in the plugin interface and install it there. Install separately for each client you use. Start a fresh session in the project and explicitly ask to use using-git-worktrees with a bounded task.
/plugin install superpowers@claude-plugins-official
Detect existing isolation first
Adapt this first request to your project:
Use Superpowers using-git-worktrees to prepare isolated work for order export. Check whether this is already a linked worktree, inspect directory conventions and git status, then create feature/order-export from main without changing current uncommitted files. Report the path, branch, and baseline failures before feature work.
A desktop development tool may already have created a linked worktree for the task. The current instructions check for that situation and reuse it rather than nesting another checkout unnecessarily. Submodules can have similar Git path characteristics, so the presence of a .git file alone is insufficient. Prefer the host's native workspace capability when available to keep its state consistent.
Specify the starting state
Name the exact starting ref and branch, and say whether uncommitted work needs to be included. The example starts from main; local edits in the original directory do not automatically become part of that new branch. If they are needed, decide how to preserve and transfer them explicitly rather than asking the agent to guess or clean the original checkout.
For manual creation, the skill checks established project conventions and existing worktree directories. A directory such as .worktrees inside the repository must be ignored so another checkout is not accidentally treated as new project content. Agreeing on a location also makes later cleanup easier.
Establish a usable baseline
A successful checkout does not mean the application is runnable. Inspect the package manager, lockfile, and setup instructions, prepare dependencies, and run suitable baseline tests. Local environment files and untracked resources from the original directory should not be assumed to exist in the new one. Report what is missing and configure it according to project conventions.
The handoff should include the worktree path, branch, starting ref, executed checks, and pre-existing failures. That evidence helps distinguish regressions introduced during the feature from problems already present. If the baseline fails, make the continuation decision explicit.
Linked worktrees share some repository state; they are not completely independent repository copies. Before cleanup, preserve the work and use worktree management commands rather than forcing removal of a dirty directory. Preparing isolation does not authorize merging, deploying, or discarding changes. The useful result is a known workspace with a known baseline, ready for the next development step.
Interrupt unfinished work for an urgent fix
Suppose worktree A contains an unfinished reporting feature when production needs a login callback fix. First inspect A's uncommitted files and choose the stable branch or commit that should start the fix. Create worktree B; edits in the two directories do not synchronize automatically. Prepare dependencies in B and run a relevant baseline login test. If the new directory shows uncommitted reporting code, stop and investigate the path or starting point rather than building on the wrong state.
After the fix, record B's branch, commit, and verification. Integrate through the normal Git workflow; neighboring directories are not a reason to copy files over A. Before removing B, check untracked and uncommitted files, confirm the fix and useful logs are saved, and use any native cleanup provided by the desktop tool. A worktree isolates tracked files but does not automatically duplicate databases, environment variables, or account credentials.
Locate the new worktree before working
Confirm the destination path before starting isolated work, not just the branch name. With an older default choice, one user accumulated more than 1 GB of worktrees for three branches in a global config directory, making edits and build outputs hard to find. Ask the agent to report the absolute path, current branch, and baseline checks after creation. If you want project-local management, configure that location and its ignore rule first. Use git worktree list when cleaning up so you do not remove a workspace containing uncommitted changes.