← ClaudeAtlas

git-branch-cleanuplisted

Worktree-scoped cleanup — remove the current worktree and its working branch only, leaving other worktrees and branches untouched
tatsushige-i/shared-claude-code · ★ 0 · Code & Development · score 60
Install: claude install-skill tatsushige-i/shared-claude-code
# Branch Cleanup Skill Clean up only the **current worktree** and the **working branch checked out in it** after a PR is merged. This skill assumes a parallel development workflow where Claude Code and Codex each operate in their own clones / worktrees and may have multiple in-flight Issues at once. Other local branches and other worktrees (e.g., Claude Code's main clone, another Issue's Codex worktree) are **never** deleted and never block this skill. ## Scope - **Targets**: the current worktree (the one this skill is invoked from) and the branch currently checked out in it. - **Out of scope**: every other local branch, every other linked worktree, and every other clone. They are neither inspected nor modified. - The skill takes no arguments. ## Execution Policy All operations are pre-approved when the user explicitly runs `/git-branch-cleanup`. Strictly follow these rules: - **Execute all operations in a single Bash tool call command chain. Never split into multiple Bash tool calls** - Treat `gh pr view`, `git checkout <home>`, `git worktree remove`, `git branch -D`, `git fetch origin`, and `git pull --ff-only origin <home>` as pre-approved operations - Do not insert confirmation prompts like "Proceed?" or "Continue?" between steps - Stop only when an error occurs, or when the skill detects "nothing to clean" (current branch is a protected `main`/`develop`/`release/*` branch) ## Execution Command Execute the following command chain as-is in **a single Bash tool cal