smart-commit

smart-commit is a skill for Claude Code from sd0xdev/sd0x-harness. It costs 78 tokens per session (18,939 once invoked), scanned C, original, MIT.

A Git assistant that examines uncommitted changes, groups related edits, and suggests commit messages that match the project's style.

In plain words
What is it for?
Use it to prepare batches of commits for manual execution or, with explicit execution, add and commit the grouped changes.
Why use it?
It reduces the effort of turning a messy working tree into clear, focused commits while helping avoid accidentally including sensitive files.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Codex.

Part of the sd0x-dev-flow plugin — 98 skills, 16 agents, 5 hooks shipped together

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 skills/sd0xdev/sd0x-harness/smart-commit
Any agent
npx skills add sd0xdev/sd0x-harness --skill smart-commit
Clone the repo
git clone --depth 1 https://github.com/sd0xdev/sd0x-harness

Made for: Claude Code.

Or install sd0x-dev-flow, the plugin that ships this one along with the rest of its 98 skills, 16 agents, 5 hooks.

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 smart-commit

README.md
[![agentmods](https://agentmods.dev/badge/skills/sd0xdev/sd0x-harness/smart-commit.svg)](https://agentmods.dev/skills/sd0xdev/sd0x-harness/smart-commit)
Your own site
<a href="https://agentmods.dev/skills/sd0xdev/sd0x-harness/smart-commit"><img src="https://agentmods.dev/badge/skills/sd0xdev/sd0x-harness/smart-commit.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 18,939 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.1 $0.00078 $0.18939
Opus 5 $0.00039 $0.09470
Sonnet 5 $0.00016 $0.03788
Haiku 4.5 $0.00008 $0.01894

Measured 3d ago against content hash 30923a0b7371, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

smart-commit scanned grade C with 1 finding 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 3d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/smart-commit-dispatch.sh, scripts/smart-commit-execute.sh, scripts/smart-commit-inspect.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

.env* | *.pem | *.key | *.p12 | id_rsa* | .aws/credentials | *.secret
skills/smart-commit/SKILL.md · 812 lines

How it starts

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

Smart Commit

Analyze uncommitted changes → group by cohesion → generate commit messages → output git commands (or execute directly with --execute).

Workflow

sequenceDiagram
    participant C as Claude
    participant U as User
    C->>C: Step 1a: Detect permissions
    C->>C: Step 1b: Learn commit style
    C->>C: Step 1c: Identity diagnostics
    C->>C: Step 1d: Signing diagnostics
    C->>C: Step 1e: AI guard readiness
    C->>C: Step 2: Pre-flight check (precommit)
    C->>C: Step 3: Collect changes + exclude sensitive files
    C->>C: Step 4: Group (high cohesion)
    C->>U: Show commit plan (with Author/Signing/Guard)
    U->>C: Confirm/adjust
    loop Each commit group
        C->>C: Read diff → generate message
        C->>C: AI trailer sanitization
        alt --execute mode
            C->>C: Runtime validation → git commit
        else manual mode
            C->>U: Output git commands
        end
    end
    C->>C: Step 6: Verification + post-commit leak detection

Git Environment Policy (applies to every step below)

Every git command this skill runs itself — read or write, either mode — resolves the same question: which repository, tree, index, ancestry and configuration does it act on? The answer is pinned two ways, both defined in git-environment.md § 1: the inherited GIT_* variables are stripped, and every command carries -C "$REPO_ROOT".

Where the stripping happens depends on who runs git:

Callee How the policy is applied
A fence running git inline The canonical env -u prefix, written out literally — never through a variable, because zsh does not word-split an expansion used as a command prefix
A helper that runs its own git commands and does not strip (git-profile.sh) The prefix goes on the delegation, at the boundary
A helper that strips the same list itself (smart-commit-inspect.sh, smart-commit-execute.sh) No prefix — the script's own unset block is the policy, and prefixing it as well would state the same rule twice in two places that could drift

Read the full file on GitHub · 812 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 812 lines · 78 tokens per session scan C 30923a0b7371

Subscribe to this mod's changes

smart-commit is a skill published in the GitHub repository sd0xdev/sd0x-harness (188 stars, last pushed today), licensed MIT. It adds 78 tokens to every session and 18,939 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.