Two New Claude Code Slash Commands
· 3 min read
You finish the feature. The code works. Tests pass. But now comes the part no one likes to admit is annoying: writing a commit message that satisfies the linter, running pre-commit checks, and creating a pull request using the template your team agreed on six months ago and collectively forgot.
Technically, you could do it manually. And for a while, I did. But after fumbling through the same Git rituals for the hundredth time, I decided to script the parts that were wasting mental energy without adding value.
The result: two Claude Code slash commands that automate the mechanical parts of the Git workflow while preserving the human ones.
What the Commands Actually Do #
/gh:commit
— Beyond git commit -m "fix stuff"
#
This command automates the surprisingly fraught task of making clean, conventional commits. Here’s what it handles:
- Runs pre-commit checks in parallel (
make lint
,make build
,make docs
) - Analyzes staged changes to suggest conventional commit types
- Generates well-formatted commit messages with emoji (optional)
- Suggests splitting changes into multiple commits if mixed concerns are detected
The real win is parallelization. While one thread reviews your git diff
, another starts linting. That five seconds of impatience you usually spend skipping the checks? Gone.
It defaults to conventional commits like:
✨ feat: add user authentication system
🔧 fix: resolve memory leak in rendering process
📝 docs: update API documentation with new endpoints
The emoji is optional, but the structure isn’t. If your commit touches tests, docs, and logic, it nudges you to break it apart. Not because it’s pedantic, but because it makes the review diff bearable.
Flags include:
--no-verify
to skip checks--no-emoji
to skip the flair
/gh:pr
— Template Population Without the Tedium
#
Pull requests carry expectations: title formatting, template completion, maybe a Jira tag. This command takes care of the scaffolding:
- Validates GitHub CLI auth and confirms branch is up to date
- Reads
.github/pull_request_template.md
and pre-fills known sections - Formats the title using conventional commit rules
- Creates a draft PR by default, so you can still make it human
- Extracts ticket numbers from branch names (e.g.
feat/ABC-123-login
) and links them
You still have to write real context. But you don’t have to remember if the template says “Motivation” or “Problem Statement.”
The Philosophy: Automate Structure, Preserve Intent #
Automation tends to fail when it overreaches. These commands succeed because they stay in their lane:
- Commit message generation: automate the format, leave the message content up to you
- PR template population: automate the scaffolding, preserve your voice
- Pre-commit checks: automate entirely—there’s no creative joy in remembering to run
make lint
This isn’t about saving hours. It’s about avoiding small repeated irritants that chip away at your attention. You still choose what to commit, what to say, and how to frame it. You just don’t have to retype the same structure every time.
What It Doesn’t Do #
- It won’t review your diff. (Still on you.)
- It won’t guess your intent. If you commit garbage, it’ll format the garbage.
- It doesn’t support gitmoji purism beyond a few defaults. Sorry,
:zap:
fans.
The goal isn’t perfection. It’s consistency and convenience. You can override anything.
Available Now #
Both commands live in my Claude Code template repository.
You can alias them however you like:
/gh:commit --no-emoji
/gh:pr "Add login support for B2B customers"
Good automation should feel invisible when it works and obvious when it doesn’t. These commands aim for that middle ground, boring in all the best ways.