safe-commit

safe-commit is a skill for Claude Code from davila7/claude-with-skills. It costs 31 tokens per session (461 once invoked), scanned A, original, MIT.

A Git workflow that stages all current changes and prepares a commit message in Conventional Commits format, a standard style such as “fix: handle empty input.”

In plain words
What is it for?
Use it when your code changes are ready to commit and you want help creating the commit without overlooking unstaged files.
Why use it?
It reduces the manual work of checking changes, staging files, and writing a consistent commit message. It also asks you to review the staged changes before committing.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when your code changes are ready to commit and you…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/davila7/claude-with-skills/safe-commit
About the project

Claude With Skills is a progressive course that teaches developers to create reusable, portable Agent Skills for Claude Code, from basic SKILL.md files to advanced automation and plugin packaging. It is intended for developers who want repeatable instructions and workflows instead of repeatedly pasting the same guidance. The catalogue contains the course's skills, agents, and instruction.

davila7/claude-with-skills · 11 stars · on GitHub · claude-with-skills.vercel.app

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.

Any agent
npx skills add davila7/claude-with-skills --skill safe-commit
Clone the repo
git clone --depth 1 https://github.com/davila7/claude-with-skills

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/davila7/claude-with-skills/safe-commit.svg)](https://agentmods.dev/skills/davila7/claude-with-skills/safe-commit)
Your own site
<a href="https://agentmods.dev/skills/davila7/claude-with-skills/safe-commit"><img src="https://agentmods.dev/badge/skills/davila7/claude-with-skills/safe-commit.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 461 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00031 $0.00461
Opus 5 $0.00015 $0.00230
Sonnet 5 $0.00006 $0.00092
Haiku 4.5 $0.00003 $0.00046

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

Security

Grade A, and why

safe-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 6d 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.

src/content/docs/02-intermediate/lesson-03-allowed-tools/examples/safe-commit/SKILL.md · 72 lines

What it actually says

Safe commit workflow

Step 1: Check current state

Run:

git status

Show the output. If there is nothing to commit (working tree clean), stop and report that there are no changes to commit.

Step 2: Review what will be committed

If there are staged changes, run:

git diff --staged

If there are no staged changes but there are unstaged changes, run:

git add -A

Then confirm: "Staged all changes. Run git diff --staged to review."

Run git diff --staged and show the output.

Step 3: Generate a conventional commit message

Analyze the staged diff and write a commit message following the Conventional Commits format:

<type>(<scope>): <short summary>

<body — optional, only if the why is not obvious from the diff>

Types: feat, fix, refactor, test, docs, chore, perf, style.

Rules:

  • Summary line: 72 characters maximum, imperative mood ("add" not "adds" or "added")
  • Scope: the module, component, or file area affected (optional but recommended)
  • Body: explain why, not what — the diff already shows what

Present the proposed commit message to the user before committing.

Step 4: Commit

After presenting the message, run:

git commit -m "<generated message>"

If the commit fails (for example, a pre-commit hook rejects it), report the hook output verbatim and stop. Do not retry with a different message unless the user asks.

Step 5: Confirm

Show the result:

git status

Report the commit hash from the output of the commit command and confirm the working tree is clean.

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. 6d ago First seen · 72 lines · 31 tokens per session scan A 61220d7ddcdb

Subscribe to this mod's changes

safe-commit is a skill published in the GitHub repository davila7/claude-with-skills (11 stars, last pushed 3mo ago), licensed MIT. It adds 31 tokens to every session and 461 once invoked, about $0.0002 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.