Tooluck logoTooluck
SKILL.md

using-git-worktrees

Agent skill fromGanyuanRan/Aegis

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 to install using-git-worktrees

install using-git-worktrees
# install the Aegis pack with the skills CLI
npx skills add GanyuanRan/Aegis

# or add only this skill to Claude Code: copy the folder

skills/using-git-worktrees/

# into

~/.claude/skills/using-git-worktrees/ (all projects)

.claude/skills/using-git-worktrees/ (one project)

skills/using-git-worktrees/SKILL.md

MITFull file
1# Using Git Worktrees
2
3## Overview
4
5A worktree is an exception for simultaneously checking out another Git history,
6not a general safety badge. Prefer the current workspace and reuse an existing
7suitable worktree. A branch decision and a worktree decision are separate.
8
9**Core principle:** create only with necessity and ownership evidence; pair every
10created worktree with a cleanup path.
11
12**Announce at start:** explain which concrete checkout conflict requires a
13worktree.
14
15## Step 0: Environment Detection
16
17Before mutation, record the repository root, `HEAD`, branch/detached state,
18staged/unstaged/untracked paths, active Git operations, and:
19
20```bash
21git worktree list --porcelain
22```
23
24Classify the current host surface's task/chat-bound managed workspace semantics
25as `managed`, `non-managed`, or `unknown`. Use trusted host/session context, an
26explicit host contract, or a host-native lifecycle result; do not infer the
27classification from a product name, directory prefix, command-level `workdir`,
28missing tool, or absent metadata. `non-managed` requires positive evidence that
29the current surface lacks task-bound managed semantics. When the host exposes
30workspace fields, record the task workspace and the command's default `cwd`
31without a per-command directory override.
32
33Stop on unresolved conflicts, an active merge/rebase/cherry-pick/revert/bisect,
34or an unexplained detached HEAD. A detached HEAD is acceptable only when
35…

Excerpt shown under the repository's MIT license.

More skills in Aegis

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates