git-worktrees
Skill0 starsChanged 7 months agoMITView on GitHub
Create or manage isolated git worktrees for parallel feature work, experiments, reviews, or bug fixes without disturbing the current checkout. Use when the user wants a separate workspace or branch, asks to isolate work before implementation, or when working in the current tree risks conflicts or mixing unrelated changes.
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
- bostonaholic/rpikittheir own version, first seen Nov 8, 2026
- gabrielkoerich/skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use obsidian-bases, verification-before-completion and 10 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
OpenAISkillverification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Also in 4 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 4 projects that use this
OpenAISkillsystematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
Also in 4 projects that use this
CloudflareSkillreceiving-code-review
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
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
- +3 more from openai
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
- bostonaholic/rpikit★ 19same 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
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 repository6 other files it gives its agents.
- code-brainstormingSkill
- code-debuggingSkill
- code-explain-visuallySkill
- code-reviewingSkill
- code-simplifierSkill
- git-commitSkill
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 24 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
- Distinctive: line 14
Use commands that fit the current shell and platform.
- Distinctive: line 24
Follow this priority order:
- Very specific: line 26
Prefer an existing .worktrees/ directory.
- Distinctive: line 29
Ask the user only if the location is still ambiguous.
- Distinctive: line 35
Use git check-ignore instead of guessing.
- Distinctive: line 36
If the directory is not ignored, add an appropriate ignore rule before creating the worktree.
- Distinctive: line 37
If adding the ignore rule would create a visible repository change, call that out before committing it.
- Very specific: line 43
Use git worktree add <path> -b <branch> when creating a new branch.
- Very specific: line 44
If the branch already exists, create the worktree without -b.
- Distinctive: line 52
Run lightweight setup commands that establish a clean baseline.
- Distinctive: line 53
Avoid hardcoding package managers or shells when the repo indicates something else.
- Distinctive: line 55
Use the repository's existing scripts when available instead of inventing your own.
- Distinctive: line 59
If the project has tests or an obvious smoke-check, run the appropriate baseline check before implementation.
- Distinctive: line 61
If checks fail, stop and ask whether to proceed with a dirty baseline.
- Distinctive: line 62
If checks pass, report the workspace as ready.
- Distinctive: line 88
Fix: Always use git check-ignore before creating a project-local worktree
- Distinctive: line 93
Fix: Follow priority: existing directory > repo guidance > ask
- Distinctive: line 108
Fix: Use the active shell, and consult references/powershell.md or references/posix.md for shell-specific examples
- Distinctive: line 129
Create a worktree without verifying it is ignored when using a project-local directory
- Distinctive: line 136
Follow directory priority: existing directory > repo guidance > ask
- Distinctive: line 137
Verify directory is ignored for project-local locations
- Distinctive: line 139
Verify a clean baseline before implementation
“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
Overview
Git worktrees create isolated workspaces that share a repository while keeping separate checkouts.
Core principle: Systematic directory selection + safety verification = reliable isolation.
Use commands that fit the current shell and platform. For concrete examples, see references/powershell.md for PowerShell and references/posix.md for POSIX shells.
Workflow
1. Announce intent
State that you are setting up an isolated workspace with git worktrees.
2. Inspect existing conventions
Follow this priority order:
- Prefer an existing
.worktrees/directory. - Otherwise prefer an existing
worktrees/directory. - Otherwise check repository guidance such as
CLAUDE.md,AGENTS.md, orREADME.mdfor a preferred location. - Ask the user only if the location is still ambiguous.
3. Verify safety for project-local directories
For .worktrees/ or worktrees/, verify the directory is ignored before creating anything.
- Use
git check-ignoreinstead of guessing. - If the directory is not ignored, add an appropriate ignore rule before creating the worktree.
- If adding the ignore rule would create a visible repository change, call that out before committing it.
4. Create the worktree
Choose a path under the selected location and create the worktree on a branch that matches the task.
- Use
git worktree add <path> -b <branch>when creating a new branch. - If the branch already exists, create the worktree without
-b. - Change into the new worktree before running setup commands.
5. Prepare the project
Auto-detect the project tooling from files in the worktree.
- Install dependencies only when the repo uses a package manager that requires it.
- Run lightweight setup commands that establish a clean baseline.
- Avoid hardcoding package managers or shells when the repo indicates something else.
- Common signals:
package.jsonor a Node lockfile (npm/yarn/pnpm install),Cargo.toml(cargo build),pyproject.tomlorrequirements.txt(pip/poetry install),go.mod(go mod download). - Use the repository's existing scripts when available instead of inventing your own.
6. Verify the baseline
If the project has tests or an obvious smoke-check, run the appropriate baseline check before implementation.
- If checks fail, stop and ask whether to proceed with a dirty baseline.
- If checks pass, report the workspace as ready.
7. Report outcome
Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>Quick Reference
| Situation | Action |
.worktrees/ exists | Use it after verifying it is ignored |
worktrees/ exists | Use it after verifying it is ignored |
| No existing location | Check repo docs, then ask only if still ambiguous |
| Directory not ignored | Add ignore rule before creating the worktree |
| Tests fail during baseline | Report failures + ask |
| No obvious setup files | Skip dependency installation |
Common Mistakes
Skipping ignore verification
- Problem: Worktree contents get tracked, pollute git status
- Fix: Always use
git check-ignorebefore creating a project-local worktree
Assuming directory location
- Problem: Creates inconsistency, violates project conventions
- Fix: Follow priority: existing directory > repo guidance > ask
Proceeding with failing tests
- Problem: Can't distinguish new bugs from pre-existing issues
- Fix: Report failures, get explicit permission to proceed
Hardcoding setup commands
- Problem: Breaks on projects using different tools
- Fix: Auto-detect from project files and existing scripts
Assuming a POSIX shell
- Problem: Commands fail in PowerShell or other environments
- Fix: Use the active shell, and consult references/powershell.md or references/posix.md for shell-specific examples
Example Workflow
You: I'm using the use-git-worktrees skill to set up an isolated workspace.
[Check .worktrees/ - exists]
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
[Run project setup]
[Run baseline checks - passing]
Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement auth featureRed Flags
Never:
- Create a worktree without verifying it is ignored when using a project-local directory
- Skip baseline verification when the repo has tests or a smoke-check
- Proceed with failing baseline checks without asking
- Assume directory location when it is ambiguous
- Assume shell-specific commands will work everywhere
Always:
- Follow directory priority: existing directory > repo guidance > ask
- Verify directory is ignored for project-local locations
- Auto-detect and run project setup
- Verify a clean baseline before implementation
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.

