Skip to content
AI & Agents
Command

/clean

Clean up merged branches locally and on remote, keeping only main, dev, and gh-pages.

From plugin
claude-skills
30k169 skills127 agents169 commands2 MCP
$ npx -y skills add alirezarezvani/claude-skills --agent claude-code

Command definition

clean.md
description: Clean up merged branches locally and on remote, keeping only main, dev, and gh-pages.

Clean up stale branches that have been merged or are no longer needed.

Steps

1. **List local branches** to delete (excluding `main`, `dev`, `gh-pages`):

git branch | grep -v -E '^\*|main$|dev$|gh-pages$'

Report what will be deleted. If no branches found, say "No local branches to clean" and skip to step 3.

2. **Delete local branches** that are fully merged:

git branch -d <branch-name>

If a branch is not fully merged, report it to the user and ask whether to force-delete. Do NOT force-delete without confirmation.

3. **List remote branches** to delete (excluding `main`, `dev`, `gh-pages`, `HEAD`):

git branch -r | grep -v -E 'origin/main$|origin/dev$|origin/gh-pages$|origin/HEAD'

Report what will be deleted. If no branches found, say "No remote branches to clean" and skip to step 5.

4. **Confirm with the user** before deleting remote branches. Show the full list and wait for approval. Then delete:

git push origin --delete <branch-names>

5. **Prune stale remote refs**:

git remote prune origin

6. **Report final state**:

git branch        # local
git branch -r     # remote

Present a summary:

| Item | Count | |------|-------| | Local branches deleted | N | | Remote branches deleted | N | | Remaining local | main, dev | | Remaining remote | origin/main, origin/dev, origin/gh-pages |

Read more
@alirezarezvani
Ships withclaude-skills

411 production-ready skills for Claude Code and 12 other coding agents, covering engineering, product, marketing, compliance, finance and the C-suite. We test whether each skill loads when you ask in plain words, and publish the results.

30k200 skills127 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
29.6k
Star history of alirezarezvani/claude-skills on GitHub, a chart by star-history.com

Other commands on claude-skills.

focused-fix

focused-fix

Command

Deep-dive feature repair — systematically fix an entire feature/module across all its files and dependencies. Usage: /focused-fix…

plugin-audit

plugin-audit

Command

Comprehensive audit pipeline for skills, plugins, agents, and commands. Validates structure, quality, security, marketplace…

More commands from other plugins.

devbox-entrypoint

devbox-entrypoint

Command

Context: runloop resumes a devbox by re-running the same entrypoint script, which invokes `cn serve --id <agentId> ...`. Because…

continue12d36k
@continuedev@continuedevInstall Command
c

c

Command

Shortcut for "continue working" — pick the work in flight back up exactly where it stopped and keep going until it is done or…

lifeos2w20k
@danielmiessler@danielmiesslerInstall Command
sidecar

sidecar

Command

Spawn a read-only sidecar subagent to investigate something in this checkout without editing files, moving branches, or touching…

@builderio@builderioInstall Command