listing-stale-branches

listing-stale-branches is a skill for Claude Code from joaquimscosta/arkhe-claude-plugins. It costs 100 tokens per session (2,566 once invoked), scanned A, original, MIT.

A read-only Git branch report that finds merged branches not yet deleted and branches with no recent commits. It can inspect local branches and, optionally, branches on a remote repository.

In plain words
What is it for?
Use it to list old, inactive, or already-merged branches and adjust the inactivity period or comparison branch.
Why use it?
It shows which branches may be safe to clean up without deleting anything, including unmerged branches that need manual review.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: model in frontmatter; positional $N argument.

Good fit Use it to list old, inactive, or already-merged branches and adjust the inactivity period or comparison branch.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joaquimscosta/arkhe-claude-plugins/listing-stale-branches
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 joaquimscosta/arkhe-claude-plugins --skill listing-stale-branches
Clone the repo
git clone --depth 1 https://github.com/joaquimscosta/arkhe-claude-plugins

Made for: Claude Code.

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 listing-stale-branches

README.md
[![agentmods](https://agentmods.dev/badge/skills/joaquimscosta/arkhe-claude-plugins/listing-stale-branches/github.svg)](https://agentmods.dev/skills/joaquimscosta/arkhe-claude-plugins/listing-stale-branches)
Your own site
<a href="https://agentmods.dev/skills/joaquimscosta/arkhe-claude-plugins/listing-stale-branches"><img src="https://agentmods.dev/badge/skills/joaquimscosta/arkhe-claude-plugins/listing-stale-branches/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for listing-stale-branches

Your own site · 80×15
<a href="https://agentmods.dev/skills/joaquimscosta/arkhe-claude-plugins/listing-stale-branches"><img src="https://agentmods.dev/badge/skills/joaquimscosta/arkhe-claude-plugins/listing-stale-branches.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,566 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.00100 $0.02566
Opus 5.5 $0.00040 $0.01026
Sonnet 5.5 $0.00020 $0.00513
Haiku 4.5 $0.00010 $0.00257

Measured today against content hash 49a88c77e634, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

listing-stale-branches 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 today.

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.

plugins/git/skills/listing-stale-branches/SKILL.md · 242 lines

How it starts

The opening of the file, as written. The whole thing — 242 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Stale Branch Detection

Identify git branches that are candidates for cleanup: merged-but-not-deleted and inactive branches with no recent commits.

Auto-Invoke Triggers

This skill automatically activates when:

  1. Keywords: "stale branches", "old branches", "branch cleanup", "prune branches", "dead branches", "unused branches", "inactive branches", "branch hygiene"
  2. Actions: "list branches to delete", "find stale branches", "clean up branches"

Arguments

  • --threshold <months> — Inactivity threshold in months (default: 3)
  • --base <branch> — Base branch for merge check (default: main)
  • --remote — Include remote branch analysis

Workflow

Execute each step below using the Bash tool. This is a read-only skill — never delete branches, only report findings.

Step 1: Validate Git Repository

git rev-parse --is-inside-work-tree 2>/dev/null || echo "NOT_A_GIT_REPO"

If not a git repo, stop and inform the user.

Step 2: Parse Arguments

Parse $ARGUMENTS for:

  • --threshold N → set THRESHOLD_MONTHS=N (default: 3)
  • --base BRANCH → set BASE_BRANCH=BRANCH (default: main)
  • --remote → set INCLUDE_REMOTE=true (default: false)

Verify the base branch exists:

git rev-parse --verify "$BASE_BRANCH" 2>/dev/null || echo "BASE_BRANCH_NOT_FOUND"

If the base branch doesn't exist, try master as fallback. If neither exists, stop and inform the user.

Step 3: Calculate Inactivity Threshold

Cross-platform threshold date (epoch seconds):

# macOS
if [[ "$OSTYPE" == "darwin"* ]]; then
  threshold=$(date -v-${THRESHOLD_MONTHS}m +%s)
else
  # Linux
  threshold=$(date -d "${THRESHOLD_MONTHS} months ago" +%s)
fi
echo "Threshold date (epoch): $threshold"

Step 4: List Merged Branches

Find local branches already merged into the base branch (safe to delete):

echo "=== MERGED BRANCHES (safe to delete) ==="
merged_count=$(git branch --merged "$BASE_BRANCH" | grep -v "^\*" | grep -vw "$BASE_BRANCH" | wc -l | tr -d ' ')
git branch --merged "$BASE_BRANCH" | grep -v "^\*" | grep -vw "$BASE_BRANCH" | while IFS= read -r branch; do
  branch="${branch## }"
  last_commit_date=$(git log -1 --format='%ci' "$branch" 2>/dev/null | cut -d' ' -f1)
  echo "  $branch  (last commit: ${last_commit_date:-unknown})"
done
if [ "$merged_count" -eq 0 ]; then
  echo "  (none)"
fi
echo "Total merged: $merged_count"

Read the full file on GitHub · 242 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today First seen · 242 lines · 100 tokens per session scan A 49a88c77e634

Subscribe to this mod's changes

listing-stale-branches is a skill published in the GitHub repository joaquimscosta/arkhe-claude-plugins (21 stars, last pushed today), licensed MIT. It adds 100 tokens to every session and 2,566 once invoked, about $0.0004 per session on Opus 5.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-10-16.