Help us improve
Share bugs, ideas, or general feedback.
From go-workflow
Interactively selects and safely removes a specific git worktree for issues, checking if linked issue is closed, branch merged into default, and no uncommitted changes before removal, with optional branch deletion.
npx claudepluginhub gopherguides/gopher-ai --plugin go-workflowHow this skill is triggered — by the user, by Claude, or both
Slash command
/go-workflow:remove-worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Interactively select and safely remove a single git worktree.
Batch removes git worktrees for closed GitHub issues and merged branches. Checks status via gh CLI, reports summary, confirms before pruning and branch deletion.
Safely deletes merged Git worktrees after verifying git merge status and GitHub PR closure via gh CLI. Handles single branch or 'all' for batch cleanup post-PR merge.
Removes git worktrees and associated branches after PR merges, sub-scope consolidation, or manual cleanup. Lists worktrees if unspecified, handles uncommitted changes and paused states.
Share bugs, ideas, or general feedback.
Interactively select and safely remove a single git worktree.
$remove-worktree
git worktree list
Filter for issue worktrees (matching *-issue-* pattern). If none found, inform the user and stop.
If multiple worktrees exist, list them and ask the user which one to remove.
For the selected worktree, check:
Issue status: Is the linked issue closed?
ISSUE_NUM=$(echo "$WORKTREE_PATH" | grep -oE 'issue-([0-9]+)' | grep -oE '[0-9]+')
gh issue view "$ISSUE_NUM" --json state --jq '.state'
Merge status: Is the branch merged into the default branch?
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | sed 's/.*: //')
BRANCH_NAME=$(cd "$WORKTREE_PATH" && git branch --show-current)
git branch --merged "$DEFAULT_BRANCH" | grep -q "$BRANCH_NAME"
Uncommitted changes: Are there any pending changes?
cd "$WORKTREE_PATH" && git status --porcelain
Safe removal (issue closed + branch merged + no uncommitted changes):
Ask: "Remove worktree at $WORKTREE_PATH? (issue closed, branch merged)"
git worktree remove "$WORKTREE_PATH"
Unsafe removal (issue open, branch unmerged, or uncommitted changes):
Warn the user about the risks and ask for explicit confirmation:
git worktree remove --force "$WORKTREE_PATH"
Ask: "Also delete the branch $BRANCH_NAME?"
git branch -D "$BRANCH_NAME" 2>/dev/null || true
git push origin --delete "$BRANCH_NAME" 2>/dev/null || true