ShriD5/claude-mods/tree/main/commit-coach
commit-coach
git commit の呼び出しを横取りし、Co-Authored-By と "Generated with" の帰属行を取り除き、ステージ済み差分に基づいて雑なコミット件名を conventional commit に書き換える Claude Code プラグインです。
この mod について
Bash の git commit 呼び出しにフックし、コミットに反映される前に2つの処理を行う Claude Code プラグインです。Co-Authored-By: トレーラーと "Generated with" 行を削除し(Claude に渡されるコミット帰属テキストも空にします)、実際のステージ済み差分から高速モデルで雑な件名(fix、wip、単語1つ、72文字超の件名、conventional prefix のない件名)を書き換えます。-m、複数の -m、--message=、-am、$'...'、heredoc、-F file、-F - からメッセージを解析し、メッセージを単一引用符付きの -m 引数として書き戻します。コマンドの残りの部分はそのままです。マージ中、メッセージを新たに指定しない --amend、-C/-c/--fixup/--squash、実行時に組み立てられたメッセージ、Merge/Revert/fixup/squash 件名はスキップします。オプションは stripAttribution、rewriteSubjects、model(デフォルト haiku)です。claude --plugin-dir ./commit-coach でインストールするか、リポジトリを marketplace に追加します。
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add ShriD5/claude-mods claude plugin install commit-coach
原文 / README
commit-coach
Catches the git commit calls Claude makes and fixes two things before they land:
- Attribution.
Co-Authored-By:trailers and🤖 Generated with ...lines are taken out of the message. Claude is also no longer told to add them, so they mostly stop showing up at all. - Lazy subjects. A subject like
fix,wip,update,stuff, a single word, anything over 72 characters, or anything without a conventional prefix (feat|fix|chore|docs|refactor|test|perf|build|ci|style) is rewritten from the actual diff by a fast model:
commit-coach: 'fix' → 'fix(scheduler): handle empty slot list'
Your own body is kept if you wrote one; the model only adds a short body when there was none. If the model's answer is not a clean conventional subject of 72 characters or less, your message goes through as it was, and a toast says so.
It reads every way a message gets into a commit: -m, several -m, -m"...", --message=, -am, $'...', the -m "$(cat <<'EOF' ... EOF)" heredoc agents like to use, -F file, and -F - fed by a heredoc. The new message goes back in as plain single-quoted -m arguments; everything else in the command (git add -A && ... && git push) is left exactly as it was.
It leaves a commit entirely alone while a merge is in progress (MERGE_HEAD exists), for --amend without a new message, -C/-c/--fixup/--squash, and when the shell builds the message at run time ("$MSG", "$(git log ...)"). Subjects starting with Merge , Revert ", fixup! or squash! are never rewritten.
Install
claude --plugin-dir ./commit-coach
or add this repo as a marketplace and install it with /plugin.
Options
| option | default | what it does |
| --- | --- | --- |
| stripAttribution | true | Remove Co-Authored-By: and "Generated with" lines, and empty the commit attribution text Claude is given. Note: this strips every Co-Authored-By: trailer, a human pair's included. |
| rewriteSubjects | true | Rewrite lazy subjects from the diff. |
| model | haiku | The model that writes the new subject: an alias or a full model id. |
How it works
A tool.call hook on Bash lexes the command (keeping each token's position), reads the commit message, and when it needs a new subject runs git diff --cached (or git diff HEAD after -a or a git add in the same command) and asks $.model.complete; it then calls next({ ...e, command }) with the rewritten command, and adds a note to the result so Claude knows the new message is intended and doesn't amend it back. An attribution.text hook for commit answers an empty string.
Only the first git commit in a command is coached.
