finish-branch

finish-branch is a skill for Claude Code from KhaledSaeed18/dotclaude. It costs 68 tokens per session (1,082 once invoked), scanned A, original, MIT.

A guide for closing a completed Git development branch. It verifies the work, checks the repository or worktree state, and helps choose how to integrate or remove the branch.

In plain words
What is it for?
Use it after implementation is complete and tests should pass. It presents options such as merging, opening a pull request, keeping the branch, or discarding it, then carries out the selected option safely.
Why use it?
It prevents unfinished or failing work from being merged and reduces the risk of losing changes during branch or workspace cleanup.

Skill for Claude Code

Written for Claude Code: a Claude Code plugin manifest.

Part of the git plugin — 9 skills, 1 command shipped together

Good fit Use it after implementation is complete and tests should pass. It presents options such as merging, opening a pull request, keeping the branch, or discarding it, then carries out the selected option safely.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khaledsaeed18/dotclaude/finish-branch
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 KhaledSaeed18/dotclaude --skill finish-branch
Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

Made for: Claude Code.

Or install git, the plugin that ships this one along with the rest of its 9 skills, 1 command.

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 finish-branch

README.md
[![agentmods](https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/finish-branch/github.svg)](https://agentmods.dev/skills/khaledsaeed18/dotclaude/finish-branch)
Your own site
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/finish-branch"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/finish-branch/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 finish-branch

Your own site · 80×15
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/finish-branch"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/finish-branch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,082 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.00068 $0.01082
Opus 5 $0.00034 $0.00541
Sonnet 5 $0.00014 $0.00216
Haiku 4.5 $0.00007 $0.00108

Measured 9d ago against content hash 3d35a8498b47, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

finish-branch 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 9d 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-plugin/plugins/git/skills/finish-branch/SKILL.md · 79 lines

How it starts

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

Bring a finished branch to a clean conclusion: confirm the work actually passes, figure out what kind of workspace you're in, offer the user a small set of concrete options, and carry out their choice without losing anything. The shape is always the same — verify, detect, present, execute, clean up.

Step 1: Verify tests before offering anything

Run the project's full test suite (npm test / cargo test / pytest / go test ./... as appropriate). If anything fails, stop here — show the failures and say the work can't be merged or turned into a PR until they pass. Don't present the options menu over a red suite. (The verify-completion skill is the standard: run it, read the output, then proceed.)

Step 2: Detect the workspace state

GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
  • GIT_DIR == GIT_COMMON — a normal repo checkout; no worktree to clean up.
  • GIT_DIR != GIT_COMMON, on a named branch — a linked worktree; cleanup depends on who created it (Step 5).
  • GIT_DIR != GIT_COMMON, detached HEAD — externally managed; offer the reduced menu and don't clean up.

Also determine the base branch the work split from:

git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null

If it's ambiguous, ask: "This branch came off main — correct?"

Step 3: Present the options

For a normal repo or a named-branch worktree, present exactly these four, with no extra explanation:

Implementation complete. What would you like to do?

1. Merge back into <base> locally
2. Push and open a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work

Which option?

For a detached HEAD, present the reduced three (no local merge): push as a new branch and open a PR / keep as-is / discard.

Step 4: Execute the choice

1 — Merge locally. From the main repo root (not inside the worktree), check out the base, pull, and merge the feature branch. Re-run the tests on the merged result. Only after the merge succeeds and tests pass: clean up the worktree (Step 5), then git branch -d <feature>.

Read the full file on GitHub · 79 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. 9d ago First seen · 79 lines · 68 tokens per session scan A 3d35a8498b47

Subscribe to this mod's changes

finish-branch is a skill published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed today), licensed MIT. It adds 68 tokens to every session and 1,082 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.

Related

Other skills, from other repositories

pre-publish-review

Nuclear-grade 12-agent pre-publish release gate. Runs /get-unpublished-changes to detect all changes since last npm release, spawns up to 10 ultrabrain agents for deep per-change analysis, invokes /review-work (orchestrator manual QA plus one gate reviewer) for holistic review, and 1 oracle for overall release…

code-yeongyu/oh-my-openagent · 161 tokens

publish

Publish oh-my-opencode to npm by triggering the GitHub Actions publish workflow and verifying its artifacts. Ship-only: never runs pre-publish-review or re-reviews merged code unless the user explicitly asks. Argument: . Triggers: publish, release, deploy, npm publish.

code-yeongyu/oh-my-openagent · 68 tokens

work-with-pr

Full PR lifecycle in a fresh task-owned git worktree: implement via the ulw-loop skill with mandatory evidence-bound manual QA → reviewer-readable English PR → verification loop (CI + Cubic, where Cubic is skipped only when its quota is exhausted) → merge by default → worktree cleanup. Decomposes one task into the…

code-yeongyu/oh-my-openagent · 211 tokens

lcx-contribute-bug-fix

Contribute a verified bug fix for LazyCodex, lazycodex-ai, omo-codex, bundled Codex skills, or upstream Codex CLI bugs. Opens a fork PR only for upstream openai/codex; LazyCodex-owned defects become a verified-fix issue on code-yeongyu/lazycodex (never a PR — that repo is a generated distribution mirror). Use when the…

code-yeongyu/oh-my-openagent · 129 tokens

git-master

Handles git work: atomic commits, rebase, squash, blame, bisect, reflog, and history questions. Use whenever a task needs a commit or a git-history investigation; skip for ordinary code edits.

code-yeongyu/oh-my-openagent · 46 tokens

get-unpublished-changes

Compare HEAD with the latest published npm versions and list all unpublished changes by release layer. Triggers: unpublished changes, changelog, what changed, whats new.

code-yeongyu/oh-my-openagent · 38 tokens