commit

A command that creates a Git commit with an automatically generated message containing the command context, time, and a numbered summary of the actions taken. Git commits are saved snapshots of project changes.

In plain words
What is it for?
It is for recording completed coding tasks in Git repositories with a consistent commit-message format.
Why use it?
It reduces the work of writing a commit message and connects the message to the actions performed during the session. It also checks which files are currently changed before proposing the commit.

Command for Claude Code

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/shanraisshan/claude-code-hooks/commit
Clone the repo
git clone --depth 1 https://github.com/shanraisshan/claude-code-hooks

Made for: Claude Code.

Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 846 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.00015 $0.00846
Opus 5 $0.00008 $0.00423
Sonnet 5 $0.00003 $0.00169
Haiku 4.5 $0.00002 $0.00085

Measured yesterday against content hash 9a0697885785, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

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/commands/commit.md · 85 lines

How it starts

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

Commit

Create a git commit with an auto-generated message. The first line is a summary, followed by a numbered list of the actions/changes that were executed.

Format

[/command-name][DD-Mon-YY HH:MM AM/PM] N changes

1. First change description
2. Second change description
...

"N changes" refers to the number of actions/changes that were executed during the session — NOT the number of git file changes. Look back through the conversation to find the actions that were taken (e.g., from a workflows:workflow-changelog report's action items, or from a workflows:workflow-add-hook workflow's steps).

Steps

  1. Get the command name from $ARGUMENTS. If empty, ask the user what command or task produced these changes.

  2. Get the current timestamp by running:

    date "+%d-%b-%y %I:%M %p"
    
  3. Read changelog/changelog.md to get the latest entry's priority actions table. Use the items in that table as the list of changes. If the command name is not workflows:workflow-changelog, fall back to reviewing the conversation to identify actions.

  4. Run git status --short to see which files were changed.

  5. Show the user the proposed commit message (title + numbered list) and the files to stage. Ask for confirmation before committing.

  6. Stage and commit — one commit per file:

    • Create a separate commit for each changed file (per CLAUDE.md Git Commit Rules)
    • Each commit message uses the same title line but includes only the change descriptions relevant to that file
    • Stage one file at a time with git add <file>, then commit using a HEREDOC
    • Format for each per-file commit:
      [/command-name][DD-Mon-YY HH:MM AM/PM] N changes
      
      1. Change description relevant to this file
      2. Another change relevant to this file
      
    • If a single change touches multiple files, include that change description in each relevant file's commit

Example

If /commit workflows:workflow-changelog is run after a session that changed 3 files with 4 total actions:

Read the full file on GitHub · 85 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. yesterday First seen · 85 lines · 15 tokens per session scan A 9a0697885785

Subscribe to this mod's changes

commit is a command published in the GitHub repository shanraisshan/claude-code-hooks (532 stars, last pushed 2mo ago), licensed MIT. It adds 15 tokens to every session and 846 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.