commit · cloudai-x — Claude Code command: what it does, how to install
Inspects staged Git changes and creates a conventional commit with an automated message.
MIT ★ 1,424 updated 2026-10-06
.claude/commands/commit.mdWhat commit does
The command inspects your staging area using git diff --cached and checks git status --short. It also reads the last 5 commits from git log to match existing project conventions.
It selects the commit type among feat, fix, docs, style, refactor, perf, test, or chore. If nothing is staged, the tool stops and asks you to add files first. Running it requires shell permissions for git status, git diff, git add, and git commit.
What it helps with
- generate a conventional commit message from staged changes
- match commit style with recent repository history
- commit staged files without manually drafting diff notes
Example prompts for the agent
- /commit
- /commit auth
- /commit fix typos in parser
How to install commit
Manually: put the files in place
.claude/commands/commit.mdCall it with /commit. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/commit.mdCall it with /prompts:commit. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/commit.prompt.mdManually: put the files in place
.gemini/commands/commit.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about commit
How to install commit in Claude Code?
Place the command file at .claude/commands/commit.md inside your project root.
What does the commit command do?
It reads the staged Git diff, constructs a type(scope): description message, and runs git commit.
What happens if no files are staged?
The command detects the empty index and asks you to stage modified files before committing.
Source text
commit.md · MIT
--- allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git add:*), Bash(git commit:*) description: Create a conventional commit with auto-generated message argument-hint: "[optional scope or message hint]" --- ## Context - Current branch: !`git branch --show-current` - Git status: !`git status --short` - Staged changes: !`git diff --cached --stat` - Staged diff: !`git diff --cached` - Recent commits (for style reference): !`git log --oneline -5 2>/dev/null || echo "No commits yet"` ## Task Based on the staged changes above, create a single git commit: 1. Analyze the staged diff to understand what changed 2. Generate a conventional commit message following the format: - `type(scope): description` - Types: feat, fix, docs, style, refactor, perf, test, chore 3. If no changes are staged, inform the user and suggest staging files 4. Execute the commit $ARGUMENTS
© CloudAI-X · MIT · CloudAI-X/claude-workflow-v2
Similar slash commands
All slash commands for Git and GitHub →commit by other authors comes first.