using-git-worktrees
Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree.
npx skills add GanyuanRan/Aegis --skill using-git-worktrees --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Using Git Worktrees ## Overview A worktree is an exception for simultaneously checking out another Git history, not a general safety badge. Prefer the current workspace and reuse an existing suitable worktree. A branch decision and a worktree decision are separate. **Core principle:** create only with necessity and ownership evidence; pair every created worktree with a cleanup path. **Announce at start:** explain which concrete checkout conflict requires a worktree. ## Step 0: Environment Detection Before mutation, record the repository root, `HEAD`, branch/detached state, staged/unstaged/untracked paths, active Git operations, and: ```bash git worktree list --porcelain ``` Stop on detached HEAD, unresolved conflicts, or an active merge/rebase/ cherry-pick/revert/bisect. Preserve user state: no automatic stash, reset, clean, broad staging, or commit. Before deciding necessity or placement, read the smallest relevant project `AGENTS.md`, `CLAUDE.md`, current authority, and existing worktree convention. Repository policy may require or forbid isolation and owns any approved in-repo location; do not discover that policy after creating the checkout. ## Step 1: Necessity Decision Crea
- Overview
- Step 0: Environment Detection
- Step 1: Necessity Decision
- Step 2: Safe Placement
- Step 3: Create the Minimum Checkout
- Step 4: Authority-Led Setup and Baseline
- Step 5: Handoff and Cleanup Ownership
- Red Flags
- Integration
git worktree list --porcelain Existing branch git worktree add <exact-path> <branch> New independently justified branch git worktree add -b <branch> <exact-path> <start-point>
What does the using-git-worktrees skill do?
Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree.
How do I install it?
Run `npx skills add GanyuanRan/Aegis --skill using-git-worktrees --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From GanyuanRan/Aegis, a repository with 902 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
