my_commit

A command for creating a Git commit that follows the project's existing message style. Git is a system for tracking code changes, and a commit records a set of changes.

In plain words
What is it for?
Use it to commit current changes, generate a message when needed, detect conventions from recent history, or amend a previous commit.
Why use it?
It avoids manually guessing the repository's commit format and performs basic checks before recording changes. It can also amend the user's previous commit.

Command

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/anilcancakir/claude-code-plugins/my_commit
Clone the repo
git clone --depth 1 https://github.com/anilcancakir/claude-code-plugins
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,908 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.00029 $0.01908
Opus 5 $0.00015 $0.00954
Sonnet 5 $0.00006 $0.00382
Haiku 4.5 $0.00003 $0.00191

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

Security

Grade A, and why

my_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 2d 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.

pre-commit-flow/commands/my_commit.md · 278 lines

How it starts

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

Smart Commit Command

Create a commit following the project's commit message conventions. Auto-detects style from git history.

Arguments

Parse from $ARGUMENTS:

  • message: Optional commit message (if not provided, generate from changes)
  • --amend: Amend the previous commit (only your own commits)

Execution Steps

Step 1: Pre-Commit Checks

# Verify there are changes to commit
git status --porcelain

# Check we're not on protected branch
BRANCH=$(git branch --show-current)
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
  echo "Warning: Committing directly to $BRANCH"
fi

Step 2: Detect Commit Style

Analyze recent commits to detect project convention:

# Get last 10 commit messages
git log --oneline -10

Detection with Regex Patterns:

# Run these patterns against git log output to detect style

# Conventional Commits with scope: type(scope): message
CONVENTIONAL_SCOPED="^[a-f0-9]+ (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)\([a-zA-Z0-9_-]+\)!?: .+"

# Conventional Commits without scope: type: message
CONVENTIONAL_SIMPLE="^[a-f0-9]+ (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)!?: .+"

# Gitmoji: :emoji: message or unicode emoji
GITMOJI="^[a-f0-9]+ :[a-z_]+: .+|^[a-f0-9]+ (🎨|🐛|✨|📝|🔥|💚|✅|🔒|⬆️|⬇️|♻️|🔧|🌐|💄|🎉|🚀|💥) .+"

# Simple: Plain text (fallback)

Detection Algorithm:

COMMITS=$(git log --oneline -10 2>/dev/null)
TOTAL=$(echo "$COMMITS" | wc -l)

# Count matches for each style
CONV_SCOPED=$(echo "$COMMITS" | grep -cE '^[a-f0-9]+ (feat|fix|docs|style|refactor|perf|test|chore)\([^)]+\): ' || echo 0)
CONV_SIMPLE=$(echo "$COMMITS" | grep -cE '^[a-f0-9]+ (feat|fix|docs|style|refactor|perf|test|chore): ' || echo 0)
GITMOJI_COUNT=$(echo "$COMMITS" | grep -cE '^[a-f0-9]+ :[a-z_]+: ' || echo 0)

# Determine dominant style (>50% of commits)
if [ $CONV_SCOPED -gt $((TOTAL / 2)) ]; then
  STYLE="conventional-scoped"
elif [ $CONV_SIMPLE -gt $((TOTAL / 2)) ]; then
  STYLE="conventional"
elif [ $GITMOJI_COUNT -gt $((TOTAL / 2)) ]; then
  STYLE="gitmoji"
else
  STYLE="simple"
fi

Read the full file on GitHub · 278 lines

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. 2d ago First seen · 278 lines · 29 tokens per session scan A 94b3d6e705c2

Subscribe to this mod's changes

my_commit is a command published in the GitHub repository anilcancakir/claude-code-plugins (6 stars, last pushed 7mo ago), licensed MIT. It adds 29 tokens to every session and 1,908 once invoked, about $0.0001 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-31.