# Git Clean

> Clean up local branches marked as [gone] and their associated worktrees Use when this capability is needed.

- Skill: `tomevault-io/git-clean` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/git-clean`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/git-clean/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/git-clean

---


## Context
- Branches: !`git branch -v`
- Worktrees: !`git worktree list`

## Task

Clean up local branches that have been deleted from the remote (marked `[gone]`).

### Steps

1. From the branch list above, identify branches marked `[gone]`
2. If none found, report that no cleanup is needed and stop
3. **List the branches that will be deleted and ask for confirmation before proceeding**
4. For each confirmed branch:
   - If it has an associated worktree (shown in worktree list), remove the worktree first with `git worktree remove --force`
   - Delete the branch with `git branch -D`
5. Report what was removed

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/letstakeawalk) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

