Let Claude Write Your Conventional Commit Messages
Writing consistent, meaningful commit messages is one of those things everyone agrees is good practice and almost nobody does consistently. Let Claude handle it — pipe your staged diff and get a properly formatted message back.
git diff --staged | claude -p "Write a conventional commit message for these changes.
Output only the commit message, nothing else."
Use it directly in a git commit call:
git commit -m "$(git diff --staged | claude -p 'Write a conventional commit message. Output only the message.')"
Add a shell alias to make it a one-keystroke habit:
# Add to ~/.zshrc or ~/.bashrc
alias gcm='git commit -m "$(git diff --staged | claude -p "Write a conventional commit message for these staged changes. Output only the message with no explanation.")"'
Now you just stage your changes and run gcm:
git add src/auth/
gcm
# → feat(auth): add refresh token rotation with sliding expiry
You can extend the prompt to follow your team's specific conventions — mention your ticket prefix format, scope naming rules, or character limits and Claude will follow them.
Commit messages are documentation for your future self and your team.
Never write fix stuff again — make Claude write commit messages the way they were meant to be written.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.