git-worktree
Skill1 starsChanged 15 days agoMITView on GitHub
Git worktree management skill for parallel development with Claude Code. Use when you need to: (1) Create a new worktree for parallel task development, (2) List all active worktrees, (3) Merge a worktree branch back to main using rebase + ff-only strategy, (4) Clean up completed worktrees. Maintains linear git history with rebase workflow.
- Commits and pushes
30 other projects use a version of this.
Adopted by
Most recently taken up by
- aegntic/compound-engineeringtheir own version, first seen Nov 8, 2026
- sbluemin/fleet-harnesstheir own version, first seen Nov 8, 2026
- yuri-xyz/skillstheir own version, first seen Nov 8, 2026
- iliaal/ai-skillstheir own version, first seen Nov 7, 2026
- eliasjnior/claude-skillstheir own version, first seen Nov 1, 2026
- tovrleaf/openkatatheir own version, first seen Nov 1, 2026
Used with
Projects with it also use agent-native-architecture, document-review and 6 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.
CodeWithBehnamSkillagent-native-architecture
Build applications where agents are first-class citizens. Use this skill when designing autonomous agents, creating MCP tools, implementing self-modifying systems, or building apps where features are outcomes achieved by agents operating in a loop.
Also in 3 projects that use this
CodeWithBehnamSkilldocument-review
This skill should be used to refine brainstorm or plan documents before proceeding to the next workflow step. It applies when a brainstorm or plan document exists and the user wants to improve it.
Also in 3 projects that use this
MicrosoftSkillgit-commit
Stage user-selected paths, confirm the exact staged set, and create one local Conventional Commit, or generate a commit message for staged changes without committing. Use when you want a guarded commit or a ready-to-paste message.
Also in 3 projects that use this
MicrosoftSkillgrill-with-docs
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
Also in 3 projects that use this
OpenAISkillbrainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Also in 3 projects that use this
BlockSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Also in 4 projects that use this
Other versions30 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 30
- davidondrej/skills★ 4.3ksame name
- iliaal/ai-skills★ 45same name
- sbluemin/fleet-harness★ 17same name
- BackToCimaCoppi/Praxis★ 6same name
- dzianisv/skills★ 4same name
- KroxiDev/engineering-skills★ 4same name
- MithunWijayasiri/dotclaude★ 4same name
- CodeWithBehnam/cc-docs★ 2same name
- hmj1026/dhpk★ 2same name
- tsubakimoto/skills★ 2same name
20 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 repository117 other files it gives its agents.
- vercel-react-best-practices/AGENTS.mdAGENTS.md
- xhs-visual-director-skill/AGENTS.mdAGENTS.md
- mattpocock-skills/CLAUDE.mdCLAUDE.md
- about-face-4Skill
- ab-test-setupSkill
- ad-creativeSkill
- ai-seoSkill
- analytics-trackingSkill
- b2b-sales-opportunity-followupSkill
- backend-concurrency-auditSkill
- ckm:banner-designSkill
- better-colorsSkill
- brand-guidelinesSkill
- ckm:brandSkill
- churn-preventionSkill
- claude-md-optimizerSkill
- clean-architectureSkill
- coach-sales-callSkill
- code-chain-study-commentsSkill
- cold-emailSkill
- competitor-alternativesSkill
- content-strategySkill
- copy-editingSkill
- copywritingSkill
- cross-project-delivery-acceptanceSkill
- daring-design-iterationSkill
- deploy-to-vercelSkill
- ckm:designSkill
- domain-skill-factorySkill
- domain-skill-loopSkill
- email-sequenceSkill
- form-croSkill
- free-tool-strategySkill
- go-backend-clean-architectureSkill
- golang-gin-apiSkill
- golang-gin-databaseSkill
- gsap-coreSkill
- gsap-frameworksSkill
- gsap-performanceSkill
- gsap-pluginsSkill
- gsap-reactSkill
- gsap-scrolltriggerSkill
- gsap-timelineSkill
- gsap-utilsSkill
- guangzhi-b2b-salesSkill
- hatch-petSkill
- hueSkill
- impeccable-redesign-orchestratorSkill
- impeccableSkill
- ios-messaging-designSkill
- ip-as-logoSkill
- jc-audio-transcriberSkill
- jc-bookmarksSkill
- jc-client-howto-guideSkill
- jc-company-researchSkill
- jc-concept-deconstructSkill
- jc-daily-thought-social-publisher-v5Skill
- jc-decision-gradeSkill
- jc-design-teardownSkill
- jc-english-chunk-cardsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. 0 are common, 19 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 25 edited versions we read keep these.
19
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 17
When the user invokes this skill, ask them which operation they want:
- Distinctive: line 19
create: - Create a new worktree for a task
- Distinctive: line 22
cleanup: - Remove a completed worktree
- Distinctive: line 28
Create a new worktree for parallel development.
- Distinctive: line 32
Ask the user for:
- Distinctive: line 49
Create worktree as a sibling directory:
- Very specific: line 71
Always base new worktrees on origin/main (latest remote main)
- Distinctive: line 72
Never create a worktree on a branch that already has one (check with git worktree list)
- Distinctive: line 112
Ask which branch to merge (show list from git worktree list)
- Distinctive: line 119
If dirty, warn the user and ask whether to proceed.
- Distinctive: line 154
After successful merge, ask if user wants to cleanup the worktree.
- Very specific: line 157
ALWAYS use --ff-only for the final merge to main - never create merge commits
- Very specific: line 158
ONLY use --force-with-lease (never --force) and only on feature branches that were rebased
- Distinctive: line 159
NEVER force push to main
- Distinctive: line 160
If rebase has conflicts, stop and help the user resolve them before continuing
- Distinctive: line 161
Always git fetch origin before any merge operation
- Distinctive: line 167
Remove a completed worktree.
- Distinctive: line 173
Check if the branch has been merged:
- Distinctive: line 178
If NOT merged, warn the user:
- Distinctive: line 211
Never rebase main: - only rebase feature/bugfix branches
- Distinctive: line 212
Always fetch before merge: - ensure you have the latest remote state
- Distinctive: line 213
One branch per worktree: - never checkout a different branch in an existing worktree
“Common” is measured: kept by at least 6 in 10 of the 25 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 Worktree - Parallel Development with Claude Code
Overview
This skill helps you manage Git worktrees for parallel development. Each worktree is an independent working directory with its own branch, allowing multiple Claude Code sessions to work simultaneously on different tasks.
Core principle: rebase to align, ff-only to merge, linear history always.
Usage
When the user invokes this skill, ask them which operation they want:
- create - Create a new worktree for a task
- list - Show all active worktrees and their status
- merge - Merge a worktree branch back to main
- cleanup - Remove a completed worktree
Operation: create
Create a new worktree for parallel development.
Steps
- Ask the user for:
- Task description (used to generate branch name)
- Branch type:
feature/,bugfix/, orhotfix/
- Get the project root directory:
PROJECT_ROOT=$(git rev-parse --show-toplevel)
PROJECT_NAME=$(basename "$PROJECT_ROOT")- Fetch latest remote:
git fetch origin- Generate branch name from task description (lowercase, hyphens, no special chars). For example, task "add interview scoring" becomes
feature/interview-scoring. - Create worktree as a sibling directory:
# Pattern: ../{project-name}-{short-branch-suffix}
git worktree add "../${PROJECT_NAME}-${BRANCH_SUFFIX}" -b "${BRANCH_TYPE}/${BRANCH_NAME}" origin/main- Confirm creation and print instructions:
Worktree created:
Path: /Users/cv-project/jobprep-ai-{suffix}
Branch: feature/xxx
To start a parallel Claude Code session:
1. Open a new terminal
2. cd /Users/cv-project/jobprep-ai-{suffix}
3. Run: claude
4. Start working on your task
Current worktree stays unaffected.Important rules for create
- Always base new worktrees on
origin/main(latest remote main) - Never create a worktree on a branch that already has one (check with
git worktree list) - Worktree directory is always a sibling of the project root, never nested inside
Operation: list
Show all active worktrees with their status.
Steps
- Run:
git worktree list- For each worktree, show:
# For each branch in worktree list
git log --oneline -1 <branch>
git log --oneline main..<branch> | wc -l # commits ahead
git status --short --porcelain # uncommitted changes- Format output as a table:
| # | Path | Branch | Commits ahead | Uncommitted |
|---|--------------------------------|---------------------|---------------|-------------|
| 1 | /Users/cv-project/jobprep-ai-main | bugfix/production | 23 | 4 files |
| 2 | /Users/cv-project/jobprep-feature | feature/interview | 3 | clean |Operation: merge
Merge a worktree branch back to main, maintaining linear history.
Steps
- Ask which branch to merge (show list from
git worktree list) - Pre-merge checks:
# Check for uncommitted changes in that worktree
git -C <worktree-path> status --porcelainIf dirty, warn the user and ask whether to proceed.
- Determine merge strategy:
# Check if main has advanced since branch was created
git fetch origin
git log --oneline origin/main..<branch> | wc -l # branch commits
git log --oneline <branch>..origin/main | wc -l # main commits since branch4a. If main has NO new commits (fast-forward possible):
git checkout main
git pull origin main
git merge <branch> --ff-only
git push origin main4b. If main HAS new commits (need rebase first):
# Rebase the branch onto latest main
git -C <worktree-path> fetch origin
git -C <worktree-path> rebase origin/main
# If conflicts, notify user and help resolve
# After rebase, force-push the branch (only if previously pushed)
git -C <worktree-path> push origin <branch> --force-with-lease
# Then ff-only merge
git checkout main
git pull origin main
git merge <branch> --ff-only
git push origin main- After successful merge, ask if user wants to cleanup the worktree.
Important rules for merge
- ALWAYS use
--ff-onlyfor the final merge to main - never create merge commits - ONLY use
--force-with-lease(never--force) and only on feature branches that were rebased - NEVER force push to main
- If rebase has conflicts, stop and help the user resolve them before continuing
- Always
git fetch originbefore any merge operation
Operation: cleanup
Remove a completed worktree.
Steps
- Show worktree list, ask which to remove
- Check if the branch has been merged:
git branch --merged main | grep <branch>- If NOT merged, warn the user:
Warning: branch <branch> has NOT been merged to main.
Removing this worktree will NOT delete the branch, but the working directory will be gone.
Continue? (y/n)- Remove:
git worktree remove <worktree-path>
# If branch was merged, also delete the branch
git branch -d <branch>- Confirm cleanup complete.
Commit conventions
Commits in worktrees follow the same conventions as the main project. No special handling needed - each worktree is a normal git working directory.
# In any worktree, commits work normally:
git add .
git commit -m "feat: description"
git push origin <branch>Safety rules
- Never force push to main - main is protected, always ff-only
- Never delete a worktree with uncommitted changes without explicit user confirmation
- Never rebase main - only rebase feature/bugfix branches
- Always fetch before merge - ensure you have the latest remote state
- One branch per worktree - never checkout a different branch in an existing worktree
Does 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.

