I have a rule: I do not write commit messages anymore.
Not because I am lazy — because Claude Code does it better. Here is the exact command I use.
The problem with manual commit messages
Every commit message I write from memory is one of these:
- "fix stuff"
- "update"
- "wip"
- "asdfgh" (yes, really)
This is fine until you need to understand what changed 3 months ago. Then it is useless.
The command
Create a file at .claude/commands/git-commit.md with this content:
Look at the currently staged changes with `git diff --cached`. Write a conventional commit message following this exact format: `type(scope): description`. Types: feat, fix, docs, style, refactor, test, chore. Keep the subject line under 72 characters. If the change is non-obvious, add a body that explains the WHY, not the WHAT. The diff already shows the what. Output only the commit message — no preamble, no explanation.
Now type /git-commit in any Claude Code session. It reads your actual staged diff and writes a commit message specific to what you changed.
Real example
I staged changes to a React component that added keyboard navigation to a dropdown. Claude wrote:
feat(dropdown): add keyboard navigation support
Arrow keys now cycle through options. Enter selects. Escape closes.
Maintains focus within the component for accessibility compliance.
Without the command, I would have written add keyboard nav. The diff context is what makes it specific.
Why this works
Claude Code has access to your actual diff. It is not guessing what you changed — it is reading it. The command is just a constrained prompt that tells it what format to output.
How to install any slash command
- Create
.claude/commands/in your project root (or~/.claude/commands/for a global command) - Create a
.mdfile with your command name (e.g.,git-commit.md) - Put the prompt as the file content
- Run
/git-commitin a Claude Code session
That is it. The command has full access to your project context — your files, your git history, your shell.
I have 74 more of these across git, testing, debugging, refactoring, deployment, and security. If there is a specific workflow you want a command for, drop it in the comments.
Full kit (75 commands + 10 CLAUDE.md templates + 8 hooks): Claude Code Power User Kit
For further actions, you may consider blocking this person and/or reporting abuse
