Keyflow

Search Keyflow

Find a shortcut, workflow, MCP server or skill

using-git-worktrees

Community

Installation

Terminal

git clone --depth 1 https://github.com/obra/superpowers.git /tmp/using-git-worktrees-src
cp -r /tmp/using-git-worktrees-src/skills/using-git-worktrees ~/.claude/skills/using-git-worktrees

Or .claude/skills/using-git-worktrees to scope it to one repo.

Summary

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

Using Git Worktrees Overview Ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available. Core principle: Detect existing isolation first. Then use native tools. Then fall back to git. Never fight the harness. Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace." Step 0: Detect Existing Isolation Before creating anything, check if you are already in an isolated workspace. bash GITDIR=$(cd "$(git rev-parse --git-dir)" 2/dev/null && pwd -P) GITCOMMON=$(cd "$(git rev-parse --git-common-dir)" 2/dev/null && pwd -P) BRANCH=$(git branch --show-current) Submodule guard: GITDIR != GITCOMMON is also true inside git submodules. Before concluding "already in a worktree," verify you are not in a submodule: bash If this returns a path, you're in a submodule, n…

Questions

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

Claude Code: ~/.claude/skills/using-git-worktrees. Codex: ~/.agents/skills/using-git-worktrees. Antigravity: ~/.gemini/config/skills/using-git-worktrees. Use .claude/skills or .agents/skills inside a repo to scope it to one project.

More from obra/superpowers

Name
  1. brainstorming
  2. diagnosing-superpowers
  3. dispatching-parallel-agents
  4. executing-plans
  5. finishing-a-development-branch
  6. receiving-code-review
  7. requesting-code-review
  8. subagent-driven-development
Buy me a coffee