Repository inventory

shakes-tzd/contextune

Skills indexed from this repository, with install-style signals scoped to the repo.
7 skills28 GitHub stars0 weekly installsHTMLGitHubOwner profile

Overview

This skill provides expert git worktree troubleshooting, cleanup, and management. It diagnoses stuck or locked worktrees, orphaned registrations, directory/branch mismatches, and performance issues from many worktrees. It offers safe remediation steps, prevention guidance, and optional automation scripts for recurring cleanup.

How this skill works

I start with diagnostics: list worktrees, detect lock files, check registrations, disk usage, and running git processes. Based on findings I present a clear summary of issues and propose conservative fixes (remove locks, prune stale entries, remove or recreate worktrees, run git fsck). For broad cleanup I can run targeted or nuclear scripts, and I always verify repository integrity after changes.

When to use it

  • When you get "worktree is locked" or "cannot remove worktree" errors
  • If directories were deleted manually but git still lists worktrees
  • When branches conflict because a branch is already checked out elsewhere
  • If you see many worktrees harming performance or disk usage
  • Before running destructive cleanup or automation in a shared repo

Best practices

  • Diagnose before fixing: git worktree list --porcelain and inspect .git/worktrees for locks
  • Always use git worktree remove to remove worktrees; avoid rm -rf on worktree directories
  • Prune stale registrations regularly: git worktree prune
  • Delete local branches only after merge and confirmation (git branch -d)
  • Avoid interrupting git operations in worktrees; coordinate long operations during low activity

Example use cases

  • Locked worktree: detect and remove .git/worktrees/<path>/locked, then git worktree remove or --force if needed
  • Orphaned registrations: run git worktree prune to clean entries for missing directories
  • "Already exists" errors: remove leftover directory or prune then recreate with git worktree add
  • Post-sprint cleanup: remove merged worktrees and delete merged branches to reclaim disk and reduce noise
  • Nuclear cleanup: remove all non-root worktrees with confirmation and prune afterwards

FAQ

No. Lock files only indicate an interrupted operation. I verify no git processes are running and then remove locks safely; uncommitted changes in the working directory remain unless you remove the worktree directory itself.

How do I avoid orphaned worktrees in the future?

Use git worktree remove to remove worktrees, run git worktree prune regularly, and add build artifacts (node_modules, target) to .git/info/exclude so worktrees stay lightweight.

7 skills

More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational