Skills create-git-worktree
🌿

create-git-worktree

Low Risk ⚡ Contains scripts⚙️ External commands📁 Filesystem access

Create isolated git worktree environments

Managing multiple branches in the same repository can lead to context switching issues and workspace clutter. This skill automates the creation of isolated git worktrees in a dedicated directory, copying environment files and setting up clean workspaces for each feature branch.

Supports: Claude Code(CC)
📊 70 Adequate
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "create-git-worktree". Create a git worktree for branch feature/add-user-login

Expected outcome:

  • ✓ Worktree created successfully!
  • Location: /path/to/project-worktrees/feature-add-user-login
  •  
  • Next steps:
  • 1. cd /path/to/project-worktrees/feature-add-user-login
  • 2. Start working on your task

Using "create-git-worktree". Create a git worktree for bugfix/login-issue --from main

Expected outcome:

  • Creating worktree for branch: bugfix/login-issue
  • Base branch: main
  • Worktree path: /path/to/project-worktrees/bugfix-login-issue
  •  
  • ✓ Worktree created successfully!
  • Next steps:
  • 1. cd /path/to/project-worktrees/bugfix-login-issue
  • 2. Start working on your task

Security Audit

Low Risk
v5 • 1/16/2026

Benign git worktree automation script. Creates isolated development environments using standard git commands. Copies .env for local development setup, which is documented expected behavior. No network calls, no credential exfiltration patterns, no obfuscation detected. All static findings are false positives from legitimate git automation patterns.

3
Files scanned
324
Lines analyzed
3
findings
5
Total audits

Risk Factors

⚡ Contains scripts (1)
⚙️ External commands (1)
📁 Filesystem access (1)
Audited by: claude View Audit History →

Quality Score

45
Architecture
100
Maintainability
85
Content
31
Community
90
Security
83
Spec Compliance

What You Can Build

Isolated feature development

Create clean, isolated workspaces for working on feature branches without affecting your main development directory.

Review PR branches locally

Quickly check out pull request branches in isolated worktrees to test changes before merging.

Parallel experiment workspaces

Run multiple experiments or fixes simultaneously in separate worktrees for clean comparison.

Try These Prompts

Basic worktree creation
Create a git worktree for branch feature/my-new-feature
From specific base
Create a git worktree for branch hotfix/security-fix --from develop
With branch convention
Create a git worktree for branch feature/api/user-authentication
After main work
I've finished my current task. Now create a worktree for bugfix/login-issue

Best Practices

  • Use meaningful branch names that clearly describe the work being done
  • Delete worktrees after merging to keep the worktrees directory organized
  • Keep .env files updated in the main repository for consistent environment setup

Avoid

  • Creating worktrees for branches that already exist locally without checking
  • Running the script from inside a worktree directory instead of the main repo
  • Modifying files in multiple worktrees that share the same .env without understanding implications

Frequently Asked Questions

What git versions support worktree?
Git worktree requires git version 2.5 or higher. Most modern git installations support this feature.
How many worktrees can I create?
You can create as many worktrees as needed, but each requires sufficient disk space for the working copy.
Does this work with GitHub CLI or other git tools?
Yes, this script works independently and can be used alongside GitHub CLI, git aliases, or other git tools.
Is my .env file data safe?
The script only copies .env to the local worktree directory. No data is sent externally or shared.
What if the worktree creation fails?
Check that git is installed, you have repository permissions, and the branch name is valid. The script exits with error details.
How does this differ from cloning the repository?
Worktrees share the repository history with the main clone, using less disk space and enabling instant branch switching.

Developer Details

File structure