Using Git Worktrees
Isolated git worktree setup that picks a directory, verifies ignore safety, and confirms a clean test baseline.
- CCM score
- 67 of 100
- skills.sh installs
- 278
- GitHub stars
- 34.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers worktree creation from directory selection through project setup and baseline test verification before implementation begins
- Selects the location in priority order: existing
.worktrees/orworktrees/, then a CLAUDE.md preference, then a user prompt - Enforces a
git check-ignoresafety check for project-local directories, adding and committing a .gitignore entry if one is missing - Auto-detects setup from
package.json,Cargo.toml,requirements.txt,pyproject.toml, andgo.modand runs the matching install or build step - Designed for use before executing implementation plans and paired with finishing-a-development-branch for cleanup
Install
$ npx -y skills add davila7/claude-code-templates --skill using-git-worktrees -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Using Git Worktrees
Overview
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
Core principle: Systematic directory selection + safety verification = reliable isolation.
Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."
Directory Selection Process
Follow this priority order:
1. Check Existing Directories
# Check in priority order
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative
If found: Use that directory. If both exist, .worktrees wins.
2. Check CLAUDE.md
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
If preference specified: Use it without asking.
3. Ask User
If no directory exists and no CLAUDE.md preference:
No worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. ~/.config/superpowers/worktrees/<project-name>/ (global location)
Which would you prefer?
Safety Verification
For Project-Local Directories (.worktrees or worktrees)
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- Git & Releases, Agent Workflow & Planning
- First seen
- Jun 3, 2026
Questions
What does the using-git-worktrees skill do?
The using-git-worktrees skill creates isolated git worktrees so you can work on feature branches without switching away from your current workspace. It picks a worktree directory by checking existing folders, then CLAUDE.md, then asking you, and verifies the directory is git-ignored before creating anything.
How do I install the using-git-worktrees skill?
Run npx -y skills add davila7/claude-code-templates --skill using-git-worktrees -y in your project. After that, the agent can set up an isolated workspace when you start feature work or begin an implementation plan.
Which skills lead the Git & Releases category where using-git-worktrees sits?
The using-git-worktrees skill is in the Git & Releases category alongside triage, git-guardrails-claude-code, setup-pre-commit, caveman-commit and pr. It stands out by focusing on worktree creation with a baseline test run, auto-detecting setup commands for Node.js, Rust, Python and Go projects.
Does the using-git-worktrees skill need any extra tools or setup?
The skill relies on git itself and on your project's own setup tools, such as npm, cargo, pip or go, depending on which project files are present. It skips dependency installation when no package.json or Cargo.toml is found.
More from davila7/claude-code-templates
All 398- Free Tool Strategy276
- Qms Audit Expert276
- Railway Metrics276
- Firecrawl Scraper275
- Pytdc275
- Railway Domain275
- Gene Database272
- File Uploads270
- Uniprot Database269
- Ethical Hacking Methodology266
- Simpy265
- Concise Planning264
- Metabolomics Workbench Database264
- Pentest Commands264
- Diffdock262
- Clinpgx Database261
- Tavily Web261
- Geo Fundamentals259
- Gget259
- Shopify Apps255
- String Database255
- Clinvar Database254
- Reactome Database252
- Postgres Schema Design251
Similar to Using Git Worktrees
More Git & Releasesce-worktreeeveryinc/compound-engineering-plugin3.2K installsGit worktree setup that detects existing isolation first, then prefers native harness tools before falling back to plain git.
finishing-a-development-branchobra/superpowers241.5K installsGuided branch-completion workflow that verifies tests, then offers merge, PR, or keep options.
here-be-gitintellectronica/agent-skills541 installsSets up git in the current directory with optional agent commit rules and a tailored .gitignore.
git-worktreesbobmatnyc/claude-mpm-skills370 installsGit worktree setup for working on several branches at once, with stacked PR and parallel server patterns.
git-worktree-manageralirezarezvani/claude-skills609 installsParallel Git worktree setup that isolates branches, ports, and env files for multi-agent or multi-session work.
worktrunkmax-sixty/worktrunk5.6K installsGuidance for the wt CLI covering worktree hooks, project and user config, and commit message generation.