clean-branches
БесплатноБез исполняемых скриптовНе проверенClean up unnecessary local branches and prune stale remote-tracking branches
от dyoshikawa★ 1 671 звезда на GitHubОб этом скилле
Clean Branches
Clean up unnecessary local branches and prune stale remote-tracking branches.
Step 1: Inspect Current State
Run the following:
git branch --show-currentgit branch --format='%(refname:short)'git remote show origingit branch -vv
Identify:
- The current branch
- The default branch (for example
mainormaster) - Branches whose upstream has been deleted
After identifying the default branch, list branches already merged into it:
git branch --merged <default-branch>
If you want to use the remote-tracking branch as the source of truth, use:
git branch --merged origin/<default-branch>
Step 2: Refresh Remote State
Update remote refs and prune deleted remote branches:
git fetch --prune
If needed, also run:
git remote prune origin
Step 3: Select Branches to Delete
Delete only branches that are clearly unnecessary.
Safe candidates include:
- Local branches already merged into the default branch you identified above
- Local branches whose upstream branch is gone and are no longer needed
Never delete:
- The current branch
- The default branch
- Branches that are not fully merged unless the user explicitly asks for force deletion
If there is any ambiguity, show the candidate branches to the user and ask for confirmation.
Step 4: Delete Branches
For merged branches, delete them safely:
git branch -d <branch-name>
Only if the user explicitly approves force deletion for unmerged branches, use:
git branch -D <branch-name>
Delete branches one by one, not with a broad wildcard command.
Step 5: Report Result
Summarize:
- Which branches were deleted
- Which branches were skipped and why
- Whether stale remote-tracking branches were pruned
Установить clean-branches в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл clean-branches?
Clean up unnecessary local branches and prune stale remote-tracking branches
Как установить скилл clean-branches?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл clean-branches запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic