Skip to content
git

Git Clean

Audit your local repo for stale branches, large files, leftover stash entries — clean up safely.

/git-clean

Install this skill

  1. 1. Copy the SKILL.md content (button above)
  2. 2. Create a folder for the skill:
    # Mac/Linux
    mkdir -p ~/.claude/skills/git-clean
    
    # Windows (PowerShell)
    mkdir $env:USERPROFILE\.claude\skills\git-clean
  3. 3. Save the content as ~/.claude/skills/git-clean/SKILL.md
  4. 4. Restart Claude Code (or open a new session)
  5. 5. Type /git-clean to invoke it
cleanupbranchesmaintenance

/git-clean

Limpia tu repo local sin perder trabajo.

Pasos

1. Audit

Reporta qué se limpiaría:

Branches stale

Loading code…

Branches sin remoto

Loading code…

Archivos grandes en historial

Loading code…

Stash entries viejos

Loading code…

2. Confirmar con el usuario

NUNCA borrar sin pedir confirmación — el git history puede tener trabajo en progreso del usuario.

3. Ejecutar limpieza solo lo aprobado

  • git branch -d <branch> para merged
  • git branch -D <branch> solo si el usuario lo confirma explícitamente
  • git stash drop con número específico

4. NO HACER nunca

  • git reset --hard
  • git push --force
  • git clean -fd sin confirmar
  • Tocar el remoto sin permiso explícito