commit-msg

A command that reads the current Git changes and suggests a Conventional Commits message, a standard format such as feat, fix, or docs followed by a short description.

In plain words
What is it for?
Reviewing staged or unstaged changes, identifying their type and scope, and drafting a commit message.
Why use it?
It removes the need to inspect the diff and decide on a correctly formatted commit message by hand.

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/mertjane/awesome-claude-commands/commit-msg
Clone the repo
git clone --depth 1 https://github.com/mertjane/awesome-claude-commands
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 915 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.00028 $0.00915
Opus 5 $0.00014 $0.00458
Sonnet 5 $0.00006 $0.00183
Haiku 4.5 $0.00003 $0.00092

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

Security

Grade A, and why

commit-msg 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.

commands/commit-msg.md · 138 lines

How it starts

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

Generate Conventional Commit Message

Analyze the current git changes and produce a Conventional Commits message.

If $ARGUMENTS is provided, use it as the commit scope (e.g. auth, api, ui).

Step 1 — Read Git Status

Run:

git status --short

to see staged and unstaged files.

Run:

git diff --cached

to get staged changes (what will be committed).

If no staged changes, run:

git diff

to get unstaged changes instead, and note that the user should stage files first.

If neither has output, report: "No changes detected. Stage your changes with git add first." and stop.

Step 2 — Analyze Changes

Read the diff and identify:

What changed:

  • New files added → likely feat
  • Existing logic modified to fix incorrect behavior → fix
  • Code restructured without behavior change → refactor
  • CSS, formatting, whitespace only → style
  • Test files only → test
  • Markdown, comments, JSDoc → docs
  • Config, dependencies, build scripts → chore
  • Performance improvement (memoization, caching, query opt.) → perf

Scope (the area of the codebase affected):

  • If $ARGUMENTS provided, use it as scope
  • Otherwise infer from changed file paths:
    • src/components/auth/ → scope: auth
    • src/api/users/ → scope: users
    • src/hooks/ → scope: hooks
    • package.json only → scope: deps
    • Multiple unrelated areas → omit scope

Breaking change:

  • Removed exported function/type
  • Changed function signature
  • Renamed route/endpoint
  • Removed env variable

Step 3 — Draft Commit Message

Follow the Conventional Commits specification:

{type}({scope}): {subject}

{body}

{footer}

Rules:

  • type: one of feat, fix, refactor, style, test, docs, chore, perf
  • scope: optional, lowercase, no spaces (use - for multi-word: user-auth)
  • subject: imperative mood, lowercase, no period, max 72 chars ✓ add login endpointAdded login endpoint.
  • body: optional, explains why not what, wrap at 72 chars
  • footer: BREAKING CHANGE: {description} if applicable, or Closes #123

Read the full file on GitHub · 138 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 · 138 lines · 28 tokens per session scan A dd1966f4b421

Subscribe to this mod's changes

commit-msg is a command published in the GitHub repository mertjane/awesome-claude-commands (2 stars, last pushed 6mo ago), licensed MIT. It adds 28 tokens to every session and 915 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-31.