finalize

finalize is a skill for Claude Code, Codex from grimoire-rs/grimoire. It costs 74 tokens per session (2,875 once invoked), scanned C, original, Apache-2.0.

A workflow for preparing a Git branch to be merged into the main branch by rewriting its development commits into clean Conventional Commits. It can also combine the branch into one commit or show a plan without changing anything.

In plain words
What is it for?
Use it before a fast-forward merge to classify commits, squash changes, draft commit messages, and prepare a branch for landing on main.
Why use it?
It removes progress checkpoints and other development noise so the main branch receives a clearer commit history.

Skill for Claude CodeCodex

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/grimoire-rs/grimoire/finalize
Any agent
npx skills add grimoire-rs/grimoire --skill finalize
Clone the repo
git clone --depth 1 https://github.com/grimoire-rs/grimoire

Made for: Claude Code, Codex.

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 finalize

README.md
[![agentmods](https://agentmods.dev/badge/skills/grimoire-rs/grimoire/finalize.svg)](https://agentmods.dev/skills/grimoire-rs/grimoire/finalize)
Your own site
<a href="https://agentmods.dev/skills/grimoire-rs/grimoire/finalize"><img src="https://agentmods.dev/badge/skills/grimoire-rs/grimoire/finalize.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,875 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00074 $0.02875
Opus 5 $0.00037 $0.01437
Sonnet 5 $0.00015 $0.00575
Haiku 4.5 $0.00007 $0.00287

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

Security

Grade C, and why

finalize scanned grade C with 1 finding 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 3d 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.

Tells the agent never to refusehighAnti-refusal

Suppressing the ability to decline removes a core safety control; a later harmful request then succeeds.

- **Stale-pointer exception**: if the pointer's `Branch:` is not the branch being finalized AND that branch's work already landed on `main` (`git rev-list --count main..<branch>` is 0, or the branch is gone), the pointer
.claude/skills/finalize/SKILL.md · 196 lines

How it starts

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

/finalize — Prepare Branch for Fast-Forward Merge

Rewrites commits in main..HEAD so branch fast-forwards onto main as clean Conventional Commits sequence. Rebasing phase of two-phase branch workflow — see workflow-git.md for full model.

Sibling /commit skill handles working phase (save progress during dev). /finalize takes messy result, produces what lands in main-branch changelog.

When To Use

Situation Use
Branch has multiple Checkpoint commits /finalize
Branch has working-phase bundles ("chore(claude): bundle skill + rules + agents") /finalize
Rebasing branch onto current main before fast-forward /finalize
Branch is one changelog entry with noise between /finalize --squash-all
Already one-concern-per-commit and rebased don't — fast-forward

Flags

  • --squash-all — skip per-commit analysis, collapse main..HEAD into single commit. Skill drafts one message for whole diff, asks approval.
  • --dry-run — produce classification + rebase plan, show, no execute. Useful for review.
  • --force — skip the active-phase check (still honors other refuse conditions). Use when no plan tracks the branch or Status block is intentionally stale.

Workflow

1. Snapshot state (parallel batch)

  • git rev-parse --abbrev-ref HEAD — current branch
  • git status --porcelain=v1 — working tree clean?
  • git fetch origin main --quiet 2>/dev/null then git rev-parse main and git rev-parse origin/main 2>/dev/null — detect if local main lags origin/main
  • git log --oneline main..HEAD — commits to finalize
  • git log -1 --pretty=%s main — tip of main (plan reference)
  • git rev-list --count main..HEAD — commit count
  • git diff --stat main..HEAD — diff shape
  • git merge-base --is-ancestor main HEAD; echo $? — local main ancestor of HEAD? (0 = yes, branch based on current local main; 1 = no, needs rebase onto main as part of finalize)

Refuse to proceed if:

Read the full file on GitHub · 196 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. 3d ago First seen · 196 lines · 0 tokens per session scan C e6f4ef8a8d8e

Subscribe to this mod's changes

finalize is a skill published in the GitHub repository grimoire-rs/grimoire (8 stars, last pushed 3d ago), licensed Apache-2.0. It adds 74 tokens to every session and 2,875 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 1 finding (tells the agent never to refuse). 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

commit-archaeologist

Reconstructs why code exists from local git history, including the introducing commit, later changes, current authors, repeated companion files, and likely intent. Use when the user asks "why does this code exist", "who wrote this function and why", or to "explain the history of this function" before a rewrite…

Shubhamsaboo/awesome-llm-apps · 82 tokens

pr-draft-summary

Create the required PR-ready summary block, branch suggestion, title, and draft description for openai-agents-python. Use before the final response whenever the current task changed runtime code, tests, examples, build/test configuration, or docs with behavior impact, regardless of perceived change size and including…

openai/openai-agents-python · 114 tokens

adk-git

Writes commit messages and pull request descriptions for the adk-python repository: Conventional Commits types and scopes, subject lines that say why a change was made, and the linked-issue and testing-plan sections the PR template requires. Use when writing or rewording a commit message, squashing commits before a…

google/adk-python · 138 tokens

commit-context

Trace a file, function, or line back to the agent session that produced its current commit. Use when the user asks "why is this code here", "what was the agent doing when this changed", "who wrote this", or wants context on a specific location in the codebase.

rohitg00/agentmemory · 61 tokens

commit-history

List recent git commits linked to agent sessions, optionally filtered by branch or repo. Use when the user asks "show agent commits", "what has the agent shipped", "list linked commits", or wants commits with their session context.

rohitg00/agentmemory · 49 tokens

novu-prepare-pr

Post-implementation PR prep for Novu feature branches — quality passes, commit/PR hygiene, CI triage, and review feedback. Use after feature work is done, when the user asks to prepare a PR, ship a branch, fix CI, address review comments, or babysit a pull request before merge.

novuhq/novu · 69 tokens