logical-commits

logical-commits is a command for Claude Code from sumihiro3/Monomi. It costs 0 tokens per session (981 once invoked), scanned A, original, MIT.

A command that reviews changed files and groups them into separate, meaningful Git commits. Git is a system for tracking code changes over time.

In plain words
What is it for?
Use it to split feature, refactoring, documentation, configuration, and other changes into logical commits, with an option to skip approval.
Why use it?
It prevents unrelated changes from being bundled into one confusing commit and prepares clear commit messages for approval.

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/sumihiro3/monomi/logical-commits
Clone the repo
git clone --depth 1 https://github.com/sumihiro3/Monomi

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for logical-commits

README.md
[![agentmods](https://agentmods.dev/badge/commands/sumihiro3/monomi/logical-commits.svg)](https://agentmods.dev/commands/sumihiro3/monomi/logical-commits)
Your own site
<a href="https://agentmods.dev/commands/sumihiro3/monomi/logical-commits"><img src="https://agentmods.dev/badge/commands/sumihiro3/monomi/logical-commits.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 981 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.00000 $0.00981
Opus 5 $0.00000 $0.00491
Sonnet 5 $0.00000 $0.00196
Haiku 4.5 $0.00000 $0.00098

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

Security

Grade A, and why

logical-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 4d 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.

.claude/commands/logical-commits.md · 89 lines

What it actually says

Logical Commits Command

変更されたファイルを分析して、論理的な単位でコミットを分割して作成します。

引数: $ARGUMENTS(autoApprove=true を指定するとコミット前のユーザー承認を省略する。省略時は autoApprove=false=現行どおりコミット前のユーザー承認必須)

処理の流れ

  1. git status で変更されたファイルを確認
  2. git diff で変更内容を確認
  3. ファイルを論理的な単位にグループ化
  4. 各グループごとに適切なコミットメッセージを作成
  5. コミット案 (分け方 + メッセージ) をユーザーに提示して承認を待つ(autoApprove=true のときは案の提示のみ行い、承認待ちを省略する)
  6. 承認後にコミットを実行

コミットの分類基準

機能追加 (feat:)

  • 新しいファイルの追加
  • 新しい機能の実装
  • 例: feat: 一覧画面に検索フィルタを追加

リファクタリング (refactor:)

  • 既存コードの改善・整理
  • import文の変更
  • ディレクトリ構造の変更
  • 例: refactor: 重複していた日付整形処理を共通関数に集約

ドキュメント (docs:)

  • README、CLAUDE.md等のドキュメント更新
  • コメントの追加・改善
  • 例: docs: CLAUDE.mdにコーディング規約を追加

設定ファイル (chore:)

  • package.json、tsconfig.json等の設定変更
  • 依存関係の追加・更新
  • 例: chore: テストフレームワークの依存パッケージを追加

コミットメッセージの形式

<type>: <subject>

<body>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
  • type: feat, refactor, docs, chore, fix など
  • subject: 変更の概要(日本語、1行)
  • body: 詳細な説明(必要に応じて)

実行

このコマンドを実行すると、Claude Code が自動的に:

  • 変更ファイルを分析
  • 論理的なグループに分類
  • 適切なコミットメッセージを生成
  • コミット案を提示してユーザー承認を取得(autoApprove=true のときは承認取得を省略)
  • 承認後に順次コミットを作成

各コミットは人間の開発者が理解しやすい単位で分割されます。

重要: ユーザー承認の取得

autoApprove=false(既定)では、commit 実行前に必ず以下をユーザーに見せて承認を取る:

  • コミットの分け方 (何件に分けるか、各コミットに含めるファイル)
  • 各コミットのメッセージ (type / subject / body)

承認の方法は AskUserQuestion または平文で「以下の内容で commit してよいですか?」 と尋ねる。「はい」「OK」「進めて」等の明示的な肯定があってから git add / git commit を実行する。

CLAUDE.md の global rule (「Only create commits when requested by the user」) との整合性を保つため、スキル経由の起動でも原則として自動 commit はしない。

例外: run-release ワークフローからの autoApprove=true 起動 (既定値は config.automation.autoApprove) は、ユーザーによるコミットの 一括承認とみなす。この場合は承認待ちを省略し、コミット案を提示したうえで 順次コミットを実行してよい。

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. 4d ago First seen · 89 lines · 0 tokens per session scan A 02c1c4da75c4

Subscribe to this mod's changes

logical-commits is a command published in the GitHub repository sumihiro3/Monomi (2 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 981 tokens. 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.