git-worktree — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited git-worktree (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
| Trigger | Action |
|---|---|
| "clone worktree from {url}" | Clone GitHub repo directly into worktree form |
| "get worktree from {repo}" | Same as clone (natural language variant) |
| "create worktree from {url}" | Same as clone |
| "convert to worktree" | Convert current repo to worktree form |
| "create worktree for {branch}" | Add worktree for branch |
| "list worktrees" | Show all worktrees with status |
| "remove worktree {name}" | Safely remove worktree |
| "troubleshoot worktrees" | Diagnose and fix issues |
| "validate worktree" | Check configuration |
Recognition patterns:
https://github.com/owner/repo, [email protected]:owner/repo.gitowner/repo, blockchaincommons/researchClone a GitHub repository directly into worktree form.
User: "clone worktree from https://github.com/BlockchainCommons/research"
Step 1: Parse GitHub URL
→ Owner: BlockchainCommons
→ Repo: research
Step 2: Check target location
→ Target: ~/Documents/Workspace/claudecode/WORKTREES/GITHUB/BlockchainCommons/research/
→ If exists: Report and stop
Step 3: Preview and confirm
"This will create:
~/Documents/Workspace/claudecode/WORKTREES/GITHUB/BlockchainCommons/research/
├── research.git/ (bare repository)
└── main/ (main branch worktree)
Proceed? [Y/n]"
Step 4: Execute clone
→ Clone as bare repository
→ Configure (core.bare=true, unset core.worktree)
→ Create main worktree
Step 5: Report success
"✅ Cloned into worktree form
Location: ~/Documents/Workspace/claudecode/WORKTREES/GITHUB/BlockchainCommons/research/
├── research.git/ (bare repository)
└── main/ (worktree) ← start here
cd ~/Documents/Workspace/claudecode/WORKTREES/GITHUB/BlockchainCommons/research/main""${SKILL_BASE:-$HOME/.claude/skills/git-worktree}/scripts/clone-as-worktree.sh" "<url>" [branch]Convert an existing local repository to worktree form.
User: "convert to worktree"
Step 1: Detect repository type
scripts/detect-repo-type.sh
→ STANDARD: Continue
→ WORKTREE: "Already in worktree form"
→ BARE: "Already a bare repository"
Step 2: Check preconditions
→ Uncommitted changes? Offer stash/commit/cancel
→ Submodules? Warn and block (v1.0)
→ Already in WORKTREES? Warn about nesting
Step 3: Extract owner from remote
scripts/extract-owner.sh
→ GitHub remote found: Extract owner
→ No remote: "Add remote first: git remote add origin <url>"
Step 4: Detect inception commit (optional)
scripts/detect-inception.sh
→ Signed inception: Note for preservation
→ No inception: Continue normally
Step 5: Preview and confirm
"This will create:
~/Documents/Workspace/claudecode/WORKTREES/GITHUB/{owner}/{repo}/
├── {repo}.git/ (bare repository)
└── main/ (main branch worktree)
⚠️ 2 uncommitted changes detected
Options: [A] Stash and convert [B] Commit first [C] Cancel"
Step 6: Execute conversion
scripts/convert-to-worktree.sh [--stash]
→ Create directory structure
→ Clone local repo as bare
→ Configure bare repository
→ Create main worktree
→ Apply stashed changes if applicable
Step 7: Validate and report
scripts/validate-setup.sh
"✅ Converted to worktree form
Location: ~/Documents/Workspace/claudecode/WORKTREES/GITHUB/{owner}/{repo}/
├── {repo}.git/ (bare repository)
└── main/ (worktree) ← start here
✓ Branches: 3 preserved
✓ History: 47 commits intact
✓ Inception: Signed commit preserved ✓
Original repository unchanged. Remove after verification:
rm -rf /original/path""${SKILL_BASE:-$HOME/.claude/skills/git-worktree}/scripts/convert-to-worktree.sh" [path] [--stash] [--force]--stash: Auto-stash uncommitted changes (includes untracked with -u)--force: Skip confirmation promptAdd a worktree for a new or existing branch.
User: "create worktree for feature/new-api"
Step 1: Verify worktree-form repository
→ Standard repo: "Convert first with 'convert to worktree'"
→ Worktree/bare: Continue
Step 2: Parse branch name
→ Branch type: feature (new feature development)
→ Directory: feature-new-api/
→ Path: ~/WORKTREES/GITHUB/{owner}/{repo}/feature-new-api/
Step 3: Check for conflicts
→ Branch has worktree? Report existing location
→ Directory exists? Offer rename/remove
Step 4: Determine branch source
→ Branch exists: Checkout existing
→ Branch on remote: Track remote
→ New branch: Create from HEAD (or --from base)
Step 5: Create worktree
scripts/create-worktree.sh feature/new-api [--from main]
Step 6: Report success
"✅ Worktree created
✓ Branch type: feature
✓ Created branch: feature/new-api from main
✓ Created worktree: feature-new-api/
cd ../feature-new-api""${SKILL_BASE:-$HOME/.claude/skills/git-worktree}/scripts/create-worktree.sh" <branch> [--from <base>] [--force]| Prefix | Type | Description |
|---|---|---|
feature/ | Feature | New feature development |
bugfix/, fix/ | Bugfix | Bug fixes |
hotfix/ | Hotfix | Emergency fixes |
docs/ | Documentation | Documentation changes |
refactor/ | Refactor | Code improvements |
release/ | Release | Release preparation |
experiment/ | Experiment | Exploration/POC |
Show all worktrees with status.
User: "list worktrees"
Step 1: Verify worktree-form repository
→ Standard repo: "Convert first with 'convert to worktree'"
Step 2: Display worktrees
scripts/list-worktrees.sh
"📁 research (BlockchainCommons)
Bare repo: ~/WORKTREES/GITHUB/BlockchainCommons/research/research.git
Worktrees:
→ main main/ (current)
develop develop/
feature/auth feature-auth/
3 worktree(s) total""${SKILL_BASE:-$HOME/.claude/skills/git-worktree}/scripts/list-worktrees.sh" [path] [--json|--porcelain]--json: JSON output for scripting--porcelain: Machine-readable, one worktree per lineSafely remove a worktree.
User: "remove worktree feature-auth"
Step 1: Find worktree
→ By path: /path/to/feature-auth
→ By directory name: feature-auth
→ By branch: feature/auth → feature-auth/
Step 2: Check preconditions
→ Current directory? "Change to different worktree first"
→ Uncommitted changes? Warn and offer --force
Step 3: Remove worktree
scripts/remove-worktree.sh feature-auth [--force] [--delete-branch]
Step 4: Report success
"✅ Worktree removed
✓ Removed worktree: feature-auth/
Remaining worktrees:
→ main main/ (current)
develop develop/""${SKILL_BASE:-$HOME/.claude/skills/git-worktree}/scripts/remove-worktree.sh" <worktree|branch> [--force] [--delete-branch]--force: Remove even with uncommitted changes (changes lost!)--delete-branch: Also delete the branch after removing worktreeDiagnose and fix common worktree issues.
User: "troubleshoot worktrees"
Step 1: Locate bare repository
scripts/detect-repo-type.sh
→ Find bare repo from current location
Step 2: Check core.bare
→ Should be 'true'
→ If wrong: Offer fix
Step 3: Check core.worktree
→ Should be unset (causes warnings if set)
→ If set: Offer fix
Step 4: Check stale entries
→ List prunable worktrees
→ Offer prune
Step 5: Check directory integrity
→ Missing worktree directories
→ Broken .git file links
Report:
"RESULT: 2 issue(s) found
ISSUE: core.worktree is set
ISSUE: 1 stale worktree entry
Run with --fix to repair:
troubleshoot.sh --fix""${SKILL_BASE:-$HOME/.claude/skills/git-worktree}/scripts/troubleshoot.sh" [path] [--fix] [--verbose]| Issue | Cause | Fix |
|---|---|---|
| core.bare not true | Manual config change | git config core.bare true |
| core.worktree set | Clone artifact | git config --unset core.worktree |
| Stale entries | Deleted worktree dirs | git worktree prune |
| Broken links | Moved directories | Recreate worktree |
The skill uses a workspace-level WORKTREES pattern:
~/Documents/Workspace/claudecode/WORKTREES/
└── GITHUB/
├── ChristopherA/ # GitHub user
│ ├── repo-name/
│ │ ├── repo-name.git/ # Bare repository
│ │ ├── main/ # Main branch worktree
│ │ └── feature-auth/ # Feature branch worktree
│ │
│ └── another-repo/
│ ├── another-repo.git/
│ └── main/
│
└── BlockchainCommons/ # GitHub organization
└── research/
├── research.git/
├── main/
└── develop/github.com/{owner}/{repo} → WORKTREES/GITHUB/{owner}/{repo}~/Documents/Workspace/claudecode/ for access| Branch | Directory |
|---|---|
main | main/ |
develop | develop/ |
feature/foo-bar | feature-foo-bar/ |
bugfix/issue-123 | bugfix-issue-123/ |
Rule: Replace / with - in directory names.
All scripts in ${SKILL_BASE:-$HOME/.claude/skills/git-worktree}/scripts/:
| Script | Purpose | Exit Codes |
|---|---|---|
clone-as-worktree.sh | Clone GitHub URL into worktree form | 0=success, 1=args, 2=failed |
convert-to-worktree.sh | Convert local repo to worktree form | 0=success, 1=precond, 2=failed |
create-worktree.sh | Add worktree for branch | 0=success, 1=precond, 2=failed |
detect-inception.sh | Find signed inception commit | 0=found/none, 1=error |
detect-repo-type.sh | Detect STANDARD/WORKTREE/BARE | 0=detected, 1=not repo |
extract-owner.sh | Parse owner/repo from remote | 0=found, 1=no remote |
list-worktrees.sh | Show all worktrees | 0=success, 1=not worktree |
remove-worktree.sh | Safely remove worktree | 0=success, 1=changes, 2=failed |
troubleshoot.sh | Diagnose and fix issues | 0=clean, 1=issues, 2=fatal |
validate-setup.sh | Verify configuration | 0=valid, 1=issues |
| Variable | Default | Description |
|---|---|---|
WORKTREE_ROOT | ~/Documents/Workspace/claudecode/WORKTREES | Root for all worktree repos |
GITHUB_HOST | GITHUB | Subdirectory for GitHub repos |
DRY_RUN | 0 | Set to 1 for preview mode |
git remote add origin <url>For advanced troubleshooting, load references/troubleshooting.md.
Git Worktree Skill v1.0.0 - December 2025
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.