Skip to main content
command CX Codex

cm — Claude Code command: what it does, how to install

cm inspects diffs for secrets, stages files individually, and formats a Conventional Commit without pushing to remotes.

MIT ★ 907 updated 2025-11-12

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/cm.md
Open on GitHub

What cm does

The command begins by running git status --short and examining individual diffs to stop credentials or secrets from slipping into history. Instead of blindly running git add ., it stages files path by path.

Next, it drafts a Conventional Commit subject limited to 72 characters with a kebab-case scope. For detailed sections covering Context, Testing, and Reviewers, it references .github/commit-template.txt, then applies the commit and displays git log -1 --stat.

This workflow intentionally halts before any push happens. Publishing changes to a remote repository requires a separate prompt such as git/cp.md.

What it helps with

  • inspect file diffs for credentials before staging
  • stage modified files individually instead of blanket staging
  • construct Conventional Commit subjects within 72 characters
  • append review and testing notes using a repository template

Example prompts for the agent

  • /cm
  • Review pending changes and commit with /cm
  • Create a Conventional Commit for staged files using /cm

How to install cm

Manually: put the files in place

.claude/commands/cm.md

Call it with /cm. For all projects use ~/.claude/commands/

Questions about cm

How to install cm in Claude Code?

Save the command markdown file to .claude/commands/cm.md inside your repository.

Does the cm command push commits to the remote?

No, it stops right after the local commit. You must publish changes separately with git/cp.md.

What commit types does cm support?

It formats messages with types like feat, fix, docs, style, refactor, perf, test, build, ci, chore, and revert.

Source text

cm.md · MIT
---
description: Stage working tree changes and create a Conventional Commit (no push).
---

1. Run `git status --short` to review pending changes.
2. For each file, open a diff (`git diff -- path/to/file`) and ensure no secrets or credentials are present.
3. Stage the files intentionally (`git add path/to/file`). Avoid `git add .` unless every change was reviewed.
4. Generate a Conventional Commit message (types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert).
   - Commit subject ≤ 72 chars.
   - Scope uses kebab-case (e.g., `feat(workflows): ...`).
   - Use `.github/commit-template.txt` for Context / Testing / Reviewers sections.
5. Run `git commit` and paste the generated message + context from the template.
6. Show the resulting commit (`git log -1 --stat`) and keep the commit hash handy.
7. **Do not push** in this command. Use `git/cp.md` when you're ready to publish.

© alirezarezvani · MIT · alirezarezvani/claude-code-skill-factory

Similar slash commands

All slash commands for Git and GitHub →

From the same set36

The whole set →

Project sponsors

Companies that keep this analytics open