
Using Git Worktrees
Sets up isolated Git worktrees so you can work on features without polluting your main workspace. Automatically picks the right directory (checks for existing .worktrees or worktrees folders, then CLAUDE.md preferences, then asks), verifies it won't get committed by accident, creates the worktree with a new branch, runs your project setup (npm install, cargo build, whatever), and confirms tests pass before you start. The ignore verification is critical because committing worktree contents is a mess to clean up. Required step before brainstorming moves to implementation or any subagent work starts, pairs with finishing-a-development-branch for cleanup.
- GitHub stars
- 492
- last updated
- Jun 11, 2026
Install
$ npx -y skills add ganyuanran/aegis --skill using-git-worktrees --agent claude-codeInstalls into .claude/skills of the current project.
Files
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:
git worktree list --porcelain
Sponsors
Details
- Repository
- github.com/ganyuanran/aegis
- Category
- Git & Pull Requests
- License
- MIT
- First seen
- Jun 11, 2026
More from ganyuanran/aegis
All 22- Verification Before Completion
- Writing Plans
- Writing Skills
- Anti Entropy Governance
- Brainstorming
- Communicating Concisely
- Dispatching Parallel Agents
- Establishing Project Context
- Executing Plans
- Finishing A Development Branch
- First Principles Review
- Goal Framing
- Long Task Continuation
- Receiving Code Review
- Recording Architecture Decisions
- Requesting Code Review
- Subagent Driven Development
- Systematic Debugging
- Test Driven Development
- Update Aegis
- Using Aegis