git-worktrees
Skill19 starsChanged 8 months agoMITView on GitHub
Isolated workspace creation for parallel development work. Use when starting feature work that needs isolation from the current workspace. Creates git worktrees with proper setup and safety verification.
- Installs packages
24 other projects use a version of this.
Adopted by
Most recently taken up by
- jeanqussa/hermes-generic-opstheir own version, first seen Nov 8, 2026
- denormans/claude-code-workflowtheir own version, first seen Nov 8, 2026
- kazemcodes/skill-treetheir own version, first seen Nov 8, 2026
- Mahesh-Bishnoi/skillstheir own version, first seen Nov 8, 2026
- gabrielkoerich/skillstheir own version, first seen Nov 1, 2026
- lost-rob0t/skillstheir own version, first seen Oct 30, 2026
Used with
Projects with it also use obsidian-bases, executing-plans and 4 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
wangzhuofengSkillobsidian-bases
Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
Also in 3 projects that use this
OpenAISkillexecuting-plans
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Also in 3 projects that use this
CloudflareSkillsecurity-audit
Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.
Also in 3 projects that use this
GoogleSkillgrill-me
A relentless interview to sharpen a plan or design.
Also in 4 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 4 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- heyitsnoah/claudesidian★ 2.6ksame name
- jamesrochabrun/skills★ 209same name
- trailofbits/dropkit★ 129same name
- CarbeneAI/Forge★ 9same name
- sergeeey/Claude-cod-top-2026★ 9same name
- gabrielkoerich/skills★ 8same name
- tstapler/dotfiles★ 8same name
- KhaledSaeed18/dotclaude★ 5same name
- vikisingh23/neuraforge-ai★ 4same name
- Mahesh-Bishnoi/skills★ 2same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- brainstormingSkill
- documenting-decisionsSkill
- finishing-workSkill
- implementing-plansSkill
- parallel-agentsSkill
- receiving-code-reviewSkill
- researching-codebaseSkill
- research-plan-implementSkill
- reviewing-codeSkill
- security-reviewSkill
- synthesizing-researchSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- writing-plansSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 15 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Create isolated workspaces for parallel development without disrupting current work.
- Distinctive: line 49
When creating worktrees, check these locations in order:
- Distinctive: line 71
If no preference found:
- Very specific: line 84
Before creating a worktree in .worktrees/ or worktrees/, verify the specific directory you're using is ignored:
- Distinctive: line 94
If the command returns exit code 0, the directory is properly ignored.
- Distinctive: line 175
Verify clean state before starting work:
- Distinctive: line 244
When planning involves isolated implementation:
- Distinctive: line 256
After implementation in worktree:
- Distinctive: line 278
Must ensure directory is gitignored
- Distinctive: line 285
No gitignore management needed
- Distinctive: line 296
Create project-local worktree without verifying gitignore: - Run git check-ignore first
- Distinctive: line 297
Skip dependency installation: - Always run npm install / cargo build / etc.
- Distinctive: line 298
Skip baseline tests: - Verify tests pass before starting work
- Very specific: line 300
Use ambiguous worktree location: - Ask user preference, default to .worktrees/
- Distinctive: line 301
Skip reading CLAUDE.md: - Check for project-specific worktree conventions
- Distinctive: line 302
Leave stale worktrees: - Remove after work is merged or abandoned
- Distinctive: line 307
Before removing a worktree:
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Worktrees
Create isolated workspaces for parallel development without disrupting current work.
Purpose
Git worktrees allow multiple branches to be checked out simultaneously in separate directories. This enables parallel work without stashing, context switching, or polluting the main workspace. This skill provides structured worktree creation with safety verification.
Integration
Called by
implementing-plans- Offers worktree isolation before implementation- User directly via
/rpikit:git-worktrees
Pairs with
finishing-work- Handles worktree cleanup after implementationwriting-plans- Plans may specify worktree isolation for high-stakes changes
When to Use
Use worktrees when:
- Starting feature work that shouldn't affect main workspace
- Working on multiple features in parallel
- Testing changes in isolation
- Running long processes while continuing other work
- Reviewing PRs without disrupting current work
Skip worktrees when:
- Quick single-file fixes
- Changes that don't need isolation
- The main workspace is already clean
Directory Selection Priority
When creating worktrees, check these locations in order:
1. Check for Existing Worktree Directory
Look for:
- .worktrees/ (hidden, preferred)
- worktrees/ (visible)
If both exist, prefer .worktrees/2. Check Project Configuration
Look in CLAUDE.md or project documentation for:
- Stated worktree location preference
- Project-specific conventions3. Ask the User
If no preference found:
"Where should worktrees be created?"
- .worktrees/ (project-local, recommended, must be in .gitignore)
- worktrees/ (project-local, visible, must be in .gitignore)
- External location (e.g., ~/worktrees/project-name/)Safety Verification
Critical for project-local worktrees:
Before creating a worktree in .worktrees/ or worktrees/, verify the specific directory you're using is ignored:
# For .worktrees/ (check returns 0 if ignored)
git check-ignore -q .worktrees
# For worktrees/ (check returns 0 if ignored)
git check-ignore -q worktreesIf the command returns exit code 0, the directory is properly ignored.
If NOT ignored:
1. Add to .gitignore
echo ".worktrees/" >> .gitignore
(or "worktrees/" depending on choice)
2. Commit the change
git add .gitignore
git commit -m "Add worktree directory to .gitignore"
3. Then proceed with worktree creationWhy this matters: Accidentally committing worktree contents creates massive, confusing commits with duplicate code.
Quick Reference
| Situation | Action |
.worktrees/ exists and is ignored | Use it |
worktrees/ exists and is ignored | Use it |
| Neither exists | Create .worktrees/, add to .gitignore, commit |
| Directory exists but not ignored | Add to .gitignore first, commit, then proceed |
| Baseline tests fail | Investigate before proceeding (may need deps/config) |
Worktree Creation Process
Step 1: Detect Project Information
Get project name: basename $(git rev-parse --show-toplevel)
Get current branch: git branch --show-current
Get default branch: git symbolic-ref refs/remotes/origin/HEADStep 2: Create Worktree
For new feature branch:
git worktree add <worktree-path> -b <branch-name>For existing branch:
git worktree add <worktree-path> <existing-branch>From specific base:
git worktree add <worktree-path> -b <branch-name> origin/mainStep 3: Auto-Detect and Run Setup
Detect project type and run appropriate setup:
If package.json exists:
npm install (or yarn, pnpm based on lockfile)
If Cargo.toml exists:
cargo build
If requirements.txt exists:
pip install -r requirements.txt (in venv if present)
If Gemfile exists:
bundle install
If go.mod exists:
go mod downloadStep 4: Run Baseline Tests
Verify clean state before starting work:
# Run project test command
npm test / cargo test / pytest / etc.If tests fail:
"Baseline tests fail in the new worktree.
This could mean:
- Missing dependencies
- Environment configuration needed
- Pre-existing failures on the base branch
Options:
- Investigate and fix (recommended)
- Proceed anyway (acknowledge failures exist)
- Abort worktree creation"Step 5: Report Ready State
"Worktree created and ready:
Location: <worktree-path>
Branch: <branch-name>
Base: <base-branch>
Tests: <pass/fail status>
To work in this worktree:
cd <worktree-path>
To return to main workspace:
cd <main-repo-path>"Worktree Management
List Worktrees
git worktree listRemove Worktree
# From main repository
git worktree remove <worktree-path>
# If worktree has changes, force removal
git worktree remove --force <worktree-path>Prune Stale Worktrees
# Remove worktrees whose directories no longer exist
git worktree pruneIntegration with RPI Workflow
With Plan Phase
When planning involves isolated implementation:
Plan approved
→ Create worktree for implementation
→ Run setup in worktree
→ Verify baseline tests
→ Begin implementation in isolated environmentWith Finishing Work
After implementation in worktree:
Implementation complete
→ Use finishing-work skill
→ If merging locally: cleanup worktree
→ If creating PR: keep worktree for review cycle
→ If discarding: cleanup worktreeExternal vs Project-Local Worktrees
Project-Local (in .worktrees/ or worktrees/)
Pros:
- Everything in one place
- Easy to find related work
- Cleans up with project deletion
Cons:
- Must ensure directory is gitignored
- Uses project disk space
External (e.g., ~/worktrees/project-name/)
Pros:
- No gitignore management needed
- Separate from project structure
- Can survive project directory changes
Cons:
- Scattered across filesystem
- May forget to clean up
Never Do These
- Create project-local worktree without verifying gitignore - Run
git check-ignorefirst - Skip dependency installation - Always run npm install / cargo build / etc.
- Skip baseline tests - Verify tests pass before starting work
- Proceed when baseline tests fail - Investigate failures before continuing
- Use ambiguous worktree location - Ask user preference, default to
.worktrees/ - Skip reading CLAUDE.md - Check for project-specific worktree conventions
- Leave stale worktrees - Remove after work is merged or abandoned
- Overuse worktrees - Reserve for substantial, isolated work, not small fixes
Cleanup Checklist
Before removing a worktree:
- Work is merged or intentionally abandoned
- No uncommitted changes (or explicitly discarded)
- Branch is deleted (if work was merged)
- No running processes in the worktree
Example Workflow
User: Create a worktree for implementing the new auth feature
Assistant: I will create a worktree for the auth feature.
[Checks for existing .worktrees/ directory]
[Runs: git check-ignore -q .worktrees]
[Exit code 0 - directory is ignored]
Creating worktree at .worktrees/auth-feature...
[Runs: git worktree add .worktrees/auth-feature -b auth-feature origin/main]
Installing dependencies...
[Detects package.json, runs: npm install]
Running baseline tests...
[Runs: npm test]
All tests pass.
Worktree created and ready:
Location: .worktrees/auth-feature
Branch: auth-feature
Base: origin/main
Tests: passingCommands Reference
# Create worktree with new branch
git worktree add <path> -b <new-branch> <base>
# Create worktree with existing branch
git worktree add <path> <existing-branch>
# List all worktrees
git worktree list
# Remove worktree
git worktree remove <path>
# Force remove (with uncommitted changes)
git worktree remove --force <path>
# Prune stale entries
git worktree pruneDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

