ShriD5/claude-mods/tree/main/commit-coach
commit-coach
git commit 호출을 가로채 Co-Authored-By 및 "Generated with" 귀속 줄을 제거하고, 스테이징된 diff를 바탕으로 대충 작성된 커밋 제목을 conventional commit으로 다시 쓰는 Claude Code 플러그인입니다.
이 mod 소개
Bash의 git commit 호출에 훅을 걸어 커밋이 반영되기 전에 두 가지를 처리하는 Claude Code 플러그인입니다. Co-Authored-By: 트레일러와 "Generated with" 줄을 제거하고(Claude에 전달하는 커밋 귀속 텍스트도 비웁니다), 실제 스테이징된 diff를 바탕으로 빠른 모델을 사용해 대충 작성된 제목(fix, wip, 한 단어, 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.
