gclean

gclean is a skill for Claude Code from wookiya1364/scv-claude-code. It costs 59 tokens per session (743 once invoked), scanned A, original, MIT.

A procedure for removing local Git branches whose matching remote branches have been deleted, often after a change has been merged. Git branches are separate lines of work in a repository.

In plain words
What is it for?
Use it to prune remote references, find local branches marked as gone, delete only eligible branches, and report the deleted names and recovery identifiers.
Why use it?
It cleans up stale local branches while protecting the main development branches and the branch currently in use. It also records a short commit identifier so a removed branch can be recovered.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

Part of the scv plugin — 1 skill, 15 commands, 1 agent, 4 hooks shipped together

Good fit Use it to prune remote references, find local branches marked as gone, delete only eligible branches, and report the deleted names and recovery identifiers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wookiya1364/scv-claude-code/gclean
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add wookiya1364/scv-claude-code --skill gclean
Clone the repo
git clone --depth 1 https://github.com/wookiya1364/scv-claude-code

Made for: Claude Code.

Or install scv, the plugin that ships this one along with the rest of its 1 skill, 15 commands, 1 agent, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gclean

README.md
[![agentmods](https://agentmods.dev/badge/skills/wookiya1364/scv-claude-code/gclean.svg)](https://agentmods.dev/skills/wookiya1364/scv-claude-code/gclean)
Your own site
<a href="https://agentmods.dev/skills/wookiya1364/scv-claude-code/gclean"><img src="https://agentmods.dev/badge/skills/wookiya1364/scv-claude-code/gclean.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 743 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.00743
Opus 5 $0.00030 $0.00371
Sonnet 5 $0.00012 $0.00149
Haiku 4.5 $0.00006 $0.00074

Measured 7d ago against content hash c968db36005c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

gclean scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/gclean/SKILL.md · 55 lines

What it actually says

/gclean — merge되어 사라진 로컬 브랜치 정리

원격에서 삭제된(merge 후 GitHub/GitLab이 head 브랜치를 지운) 브랜치의 로컬 잔여를 정리한다.

절대 규칙

  • 보호 브랜치 main · develop · stage 는 절대 삭제하지 않는다.
  • 현재 체크아웃된 브랜치는 절대 삭제하지 않는다.
  • upstream이 [gone] 인 것만 대상 (= 원격이 사라짐). ahead/behind/정상 추적 브랜치는 건드리지 않는다.
  • 삭제 결과(브랜치명 + 복구용 SHA)를 반드시 출력한다.

실행 (아래 블록을 한 번에 그대로 실행)

git fetch --prune
CURRENT=$(git symbolic-ref --quiet --short HEAD || echo "(detached)")

# gone(원격 삭제) 로컬 브랜치 목록 — 트렁크/현재 제외
GONE=$(git for-each-ref --format '%(refname:short) %(upstream:track)' refs/heads \
  | awk '$2=="[gone]"{print $1}' \
  | grep -vxE 'main|develop|stage' \
  | { grep -vxF "$CURRENT" || true; })

if [ -z "$GONE" ]; then
  echo "정리할 브랜치 없음 (gone 상태 로컬 브랜치가 없습니다)."
else
  echo "=== 삭제 대상 (upstream=gone) ==="
  # 반드시 while read 로 순회 (for b in $GONE 는 여러 줄에서 워드분할 실패)
  printf '%s\n' "$GONE" | while IFS= read -r b; do
    [ -z "$b" ] && continue
    sha=$(git rev-parse --short "$b")
    printf "  %-40s %s\n" "$b" "$(git log -1 --format='%h %s' "$b")"
    git branch -D "$b" >/dev/null 2>&1 && echo "    → 삭제됨 (복구용 SHA $sha)" || echo "    → 삭제 실패"
  done
fi

실행 후 결과를 사용자에게 보고하라. 목록에 merge된 작업 브랜치가 아닌 예상 밖 브랜치가 보이면 언급하고 확인을 권한다(그래도 삭제는 로컬 전용이라 복구 가능).

복구 (실수 시)

삭제는 로컬 전용이며 30일간 reflog로 복구 가능:

git reflog                 # 또는: git fsck --no-reflogs --lost-found
git branch <name> <sha>    # 위 출력의 '복구용 SHA'로 되살리기

참고

  • [gone] 은 "원격 브랜치가 삭제됨"만 의미한다. 드물게 "merge 안 됐는데 원격만 삭제"된 경우도 포함될 수 있다.
  • 브랜치 전략은 .github/BRANCHING.md 참조.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 55 lines · 59 tokens per session scan A c968db36005c

Subscribe to this mod's changes

gclean is a skill published in the GitHub repository wookiya1364/scv-claude-code (7 stars, last pushed 3d ago), licensed MIT. It adds 59 tokens to every session and 743 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.