finish-branch

finish-branch is a command for Claude Code from pablomarin/claude-codex-forge. It costs 0 tokens per session (1,199 once invoked), scanned A, original, MIT.

A command for merging an approved GitHub pull request—the proposed code change—and removing its related worktree and branch.

In plain words
What is it for?
Use it after review comments are resolved and the pull request is approved, when you are ready to merge into the main branch and clean up.
Why use it?
It keeps the final merge and cleanup steps in one guided workflow, while requiring confirmation before merging. It does not create commits, push code, or open pull requests.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it after review comments are resolved and the pull request is approved, when you are ready to merge into the main branch and clean up.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/pablomarin/claude-codex-forge/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.

Clone the repo
git clone --depth 1 https://github.com/pablomarin/claude-codex-forge

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/finish-branch/github.svg)](https://agentmods.dev/commands/pablomarin/claude-codex-forge/finish-branch)
Your own site
<a href="https://agentmods.dev/commands/pablomarin/claude-codex-forge/finish-branch"><img src="https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/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/commands/pablomarin/claude-codex-forge/finish-branch"><img src="https://agentmods.dev/badge/commands/pablomarin/claude-codex-forge/finish-branch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,199 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.00000 $0.01199
Opus 5.5 $0.00000 $0.00480
Sonnet 5.5 $0.00000 $0.00240
Haiku 4.5 $0.00000 $0.00120

Measured 1mo ago against content hash d86e1b8c13aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

commands/finish-branch.md · 84 lines

How it starts

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

/finish-branch — Host-Neutral Merge and Cleanup

Use after the PR is approved. This workflow merges only with explicit human authorization, preserves developer continuity, and removes the feature worktree without choosing a permanent engine.

1. Inspect and Resolve Authorized Blockers

  1. Read .forge/local/state.md and resolve the active host through its adapter.
  2. Resolve the current branch and inspect its PR state, URL, title, base, checks, and review status.
  3. If no PR exists, stop. If it is already merged, skip to continuity/cleanup.
  4. Inspect check, review and conflict blockers. Resolve authorized conflicts and preserve all intended changes. If the developer explicitly omits remaining checks for the current change, follow .forge/rules/workflow.md#explicit-human-workflow-waiver: freeze, record the actual decision/provenance and exact omissions, run unwaived checks, and commit through ordinary Git to preserve merge parents. Then push when authorized. Do not rerun waived steps, repeat a valid approval question or require manual human commit/push commands. Hosted CI/branch protections and native controls keep their authority. Report any independent remaining blocker.

2. Authorize and Merge

Show the exact merge mutation, including PR URL and merge strategy. Pause for explicit human authorization unless the human already approved this exact still-current merge. Council, reviewer, native /goal, and prior PR-creation authority cannot authorize merge.

After authorization, the agent records the actual decision and runs the selected gh pr merge command once. Do not combine it with branch deletion. Re-read PR state after any local checkout error: if the server says MERGED, continue; if it remains OPEN, report the failure and stop rather than retrying or force-merging.

3. Preserve Continuity Before Removing the Worktree

Developer-local continuity lives in .forge/local/state.md; project-owned durable knowledge lives in .forge/memory/. Never move gate receipts, /goal authorization, or candidate evidence between worktrees.

Read the full file on GitHub · 84 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. 1mo ago Changed · +6 lines d86e1b8c13aa
  2. 2mo ago Changed · +14 lines 3032d8793ae1
  3. 3mo ago Changed · -272 lines 752de08bc6b8
  4. 3mo ago First seen · 336 lines · 0 tokens per session scan A 37aef2d6d11d

Subscribe to this mod's changes

finish-branch is a command published in the GitHub repository pablomarin/claude-codex-forge (5 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,199 tokens. 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

finish-branch compared with commands from other repositories

finish-branch next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
finish-branchpablomarin/claude-codex-forgeCommand51mo agoMITA0Claude Code
landgmickel/flow-nextCommand7362d agoMITA13Claude Code
qualityDesko77/claude-code-skills-1cCommand10310d agoMITA18Claude Code
release-notesOpenHands/extensionsCommand191yesterdayMITA44Claude Code
doc-changelogchristopherlouet/claude-baseCommand63d agoMITA0Claude Code
releaseelct9620/claudekitCommand103d agoMITA11Claude Code
releaseparuff/uFawkesAICommand22d agoMITA39Claude Code