reword-commits

A command for rewriting commit messages within a chosen Git history range. A commit is a saved change in Git, and its message explains what that change contains.

In plain words
What is it for?
Use it to reword commits on the current branch, or a wider set of local branches when explicitly requested, without changing the code or other commit metadata.
Why use it?
It gives every selected commit a fresh, single-line message that follows the repository's commit-writing rules.

Command

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 commands/motlin/claude-code-plugins/reword-commits
Clone the repo
git clone --depth 1 https://github.com/motlin/claude-code-plugins
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 899 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.00021 $0.00899
Opus 5 $0.00010 $0.00449
Sonnet 5 $0.00004 $0.00180
Haiku 4.5 $0.00002 $0.00090

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

Security

Grade A, and why

reword-commits 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 2d 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.

plugins/git/commands/reword-commits.md · 89 lines

How it starts

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

Rewrite every commit message in scope to a single line that follows the git-workflow skill. Do not triage. Do not skip commits whose subjects already look fine — if the user invoked this command, every commit needs a fresh message.

ALWAYS use the code:cli and git-workflow skills. The rules in git-workflow are what to write toward.

Constraints

Use git history reword only. No interactive rebase, git commit --amend, git filter-branch, git filter-repo, or git replay. No branch switching, no force-pushing, no changes to commit content, authors, dates, parents, or trees. Messages only.

Scope

The user passed in: $ARGUMENTS

Default scope is commits on the current branch that aren't on its upstream (or on main/master if there is no upstream). If the arguments ask for a wider scope like "all branches", expand to cover every local branch's unique commits. Anything else in the arguments is extra guidance to apply on top of the git-workflow rules.

Picking the commit set

For the default scope, use <upstream>..HEAD if the branch has an upstream, otherwise main..HEAD or master..HEAD. If none of those apply, ask which base to use via AskUserQuestion.

For "all branches", collect commits reachable from each local branch but not from its upstream (or main/master fallback). A commit shared across branches gets rewritten once — git history reword updates every branch that contains it.

If the set is empty, say so and stop.

Reading each commit

Read the full message — subject and body — for every commit. A body is itself a violation of the single-line rule, so you have to see it to fix it.

Stream every full message in scope with this command:

git log --format='%H%n%B%n--END-COMMIT--' <range>

For one commit at a time:

git show --no-patch --format=%B <sha>

If a message's intent isn't clear from the text, run git show <sha> to see the diff.

Drafting

For every commit in scope, draft a replacement single-line message that:

Read the full file on GitHub · 89 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. 2d ago First seen · 89 lines · 21 tokens per session scan A 93e51d5ce29e

Subscribe to this mod's changes

reword-commits is a command published in the GitHub repository motlin/claude-code-plugins (15 stars, last pushed 3d ago), licensed Apache-2.0. It adds 21 tokens to every session and 899 once invoked, about $0.0001 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-30.