ss-cleanup

ss-cleanup is a skill for Claude Code, Codex from lbk-open/super-spec. It costs 83 tokens per session (1,817 once invoked), scanned A, original, Apache-2.0.

A cleanup procedure for finished development work that checks whether the pull or merge request is merged before removing branches and worktrees.

In plain words
What is it for?
Use it after delivery to update the default branch, remove a development worktree, and delete the completed branch locally or remotely when requested.
Why use it?
It prevents unfinished or uncommitted work from being deleted accidentally during project cleanup.

Skill for Claude CodeCodex

Part of the super-spec plugin — 20 skills shipped together

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.

agentmods
npx agentmods add skills/lbk-open/super-spec/ss-cleanup
Any agent
npx skills add lbk-open/super-spec --skill ss-cleanup
Clone the repo
git clone --depth 1 https://github.com/lbk-open/super-spec

Made for: Claude Code, Codex.

Or install super-spec, the plugin that ships this one along with the rest of its 20 skills.

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 ss-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/lbk-open/super-spec/ss-cleanup.svg)](https://agentmods.dev/skills/lbk-open/super-spec/ss-cleanup)
Your own site
<a href="https://agentmods.dev/skills/lbk-open/super-spec/ss-cleanup"><img src="https://agentmods.dev/badge/skills/lbk-open/super-spec/ss-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,817 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00083 $0.01817
Opus 5 $0.00042 $0.00908
Sonnet 5 $0.00017 $0.00363
Haiku 4.5 $0.00008 $0.00182

Measured 5d ago against content hash 2e2f7fb2ab46, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ss-cleanup 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 5d 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.

skills/ss-cleanup/SKILL.md · 128 lines

How it starts

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

Cleanup After Development

Wrap up finished work: confirm the PR/MR is merged (offer to merge it if it's still open), return to the main checkout on the up-to-date default branch, remove the development branch's worktree if it has one, and delete the spent branch locally and, optionally, on the remote.

Core principle: never delete a branch whose work isn't safely landed. A branch is only safe to delete once its PR/MR is merged, or the user explicitly confirms abandoning unmerged work. The same applies to a dirty worktree — uncommitted changes are only discarded after explicit confirmation.

Inputs

  • --merge: if the branch's PR/MR is open/draft, merge it without asking first.
  • --delete-remote: also delete the remote branch if it still exists after the merge.
  • --force: skip confirmation before discarding a dirty worktree or deleting an unmerged branch.

Step 0 — Fast exit: nothing to clean up

git fetch origin --prune
CURRENT=$(git branch --show-current)
BASE=$(git remote show origin | grep 'HEAD branch' | awk '{print $NF}')
  • Detached HEAD (CURRENT empty) → stop, report the detached state and ask what to do.
  • CURRENT already equals BASE → there's no development branch to clean up. This is the common case for lite-mode work that never left the default branch. Just run git pull --ff-only origin $BASE to refresh, report, and exit — no further steps needed.

Step 1 — Detect the PR/MR state

Use the same remote-detection logic as the ss-create-pr skill (inspect git remote get-url origin for github.com vs. gitlab.com) to pick the right CLI:

# GitHub
gh pr list --head "$CURRENT" --state all
gh pr view "$CURRENT"

# GitLab
glab mr list --source-branch "$CURRENT" --state all
glab mr view "$CURRENT"

Classify the result:

State Meaning Next step
Merged Already merged Step 3 (safe to delete)
Open / draft Exists, not merged Step 2
Closed without merging Step 2 (treat as unmerged)
None found No PR/MR was ever opened Step 2 (treat as unmerged)

Read the full file on GitHub · 128 lines

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. 5d ago First seen · 128 lines · 83 tokens per session scan A 2e2f7fb2ab46

Subscribe to this mod's changes

ss-cleanup is a skill published in the GitHub repository lbk-open/super-spec (1 stars, last pushed 14d ago), licensed Apache-2.0. It adds 83 tokens to every session and 1,817 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

phx-deps-audit

Audit Hex deps for supply-chain security risk — bidi chars, compile-time exec, maintainer changes, typosquats, CVEs. Use after mix deps.update, when checking if a package upgrade is safe, or reviewing mix.lock PR diffs.

oliver-kriska/claude-elixir-phoenix · 58 tokens

release

CONTRIBUTOR TOOL - Cut a plugin release: bump plugin.json version, finalize CHANGELOG, update README if needed, gate on make ci, commit, tag vX.Y.Z, and create the GitHub release. Use when shipping a new plugin version. NOT distributed.

oliver-kriska/claude-elixir-phoenix · 60 tokens

session-deep-dive

Deep qualitative analysis of high-signal sessions. Spawns subagents with v2 template, synthesizes patterns, compares against known findings. Use after /session-scan.

oliver-kriska/claude-elixir-phoenix · 40 tokens

brainstorm

Brainstorm Elixir/Phoenix features — explore ideas, compare approaches, gather requirements. Use when vague idea, not sure how to approach, or want to discuss before plan.

oliver-kriska/claude-elixir-phoenix · 39 tokens

tidewave-integration

Tidewave MCP runtime tools — debugging, smoke testing, live state inspection, SQL queries, hex docs. Use when evaluating code in a running Phoenix app.

oliver-kriska/claude-elixir-phoenix · 38 tokens

plugin-dev-workflow

Guide plugin development workflow — editing skills, agents, hooks, or eval framework in this repo. Use when modifying files in plugins/elixir-phoenix/, lab/eval/, or lab/autoresearch/. Ensures changes pass eval, lint, and tests before committing.

oliver-kriska/claude-elixir-phoenix · 59 tokens