---
name: using-git-worktrees
description: ALWAYS use this when the task is risky, parallel, branch-oriented, or likely to mix with unrelated local changes unless it happens inside an isolated worktree.
Using Git Worktrees
Selective Reading Rule
Start with:
references/usage-routing.md
references/quality-checklist.md
Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.
Selective Reading Rule
Start with:
references/senior-master-standard.md
Start with references/worktree-layouts.md.
Use it before creating the worktree so path layout, ignore rules, branch naming, and cleanup expectations are decided up front.
Purpose
Create a clean execution surface without disturbing the current checkout.
Workflow
Inspect repo state and local changes.
Choose the base branch and branch name.
Create the worktree in an ignored, intentional location.
Verify baseline health before editing.
Do the task inside the worktree.
Hand off to finishing-a-development-branch when the work appears complete.
Rules
Never create tracked project directories for worktrees.
Never silently mix unrelated dirty state into a new task.
Never assume direct-to-main is acceptable.
1---2name: using-git-worktrees3description: ---4---5---6name: using-git-worktrees7description: ALWAYS use this when the task is risky, parallel, branch-oriented, or likely to mix with unrelated local changes unless it happens inside an isolated worktree.8---910# Using Git Worktrees1112## Selective Reading Rule1314Start with:1516- `references/usage-routing.md`17- `references/quality-checklist.md`1819Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.2021## Selective Reading Rule2223Start with:2425- `references/senior-master-standard.md`262728Start with `references/worktree-layouts.md`.2930Use it before creating the worktree so path layout, ignore rules, branch naming, and cleanup expectations are decided up front.3132## Purpose3334Create a clean execution surface without disturbing the current checkout.3536## Workflow37381. Inspect repo state and local changes.392. Choose the base branch and branch name.403. Create the worktree in an ignored, intentional location.414. Verify baseline health before editing.425. Do the task inside the worktree.436. Hand off to `finishing-a-development-branch` when the work appears complete.4445## Rules4647- Never create tracked project directories for worktrees.48- Never silently mix unrelated dirty state into a new task.49- Never assume direct-to-main is acceptable.
Run npx skillmds@latest add anhvu1107/using-git-worktrees in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
--- It is listed under AI & ML on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
anhvu1107 (@anhvu1107) published this skill. Their other Agent Skills are listed on their SkillMD profile.