Smart git commits with Claude Code
I've been deep in to using Claude Code recently, and I love being able to ask Claude to commit changes as it makes a beautiful commit log with detail about all the changes we've made.
It got me thinking - could I combine this with one of my more frequently used bash aliases I use gwip
— a lightning-fast way to save a snapshot of my work without thinking.
The issue I find with the gwip
commits is it creates generic "WIP" messages that provide zero context. Later, when I need to understand what I was actually working on, I end up trawling through diffs trying to piece together my thought process.
Claude Code supports custom commands, so I've created a /gwip
command that gives me:
- The same quick snapshot workflow I'm used to
- AI-generated commit messages that actually describe what changed
- Automatic CI skipping with
[skip ci]
- No commit verification for maximum speed
Setting It Up
Create the following command in .claude/commands/gwip.md
:
---
description: "Creates a commit for work-in-progress. This might not be fully testable and functional but we want to snap this point in time"
allowed-tools:
[
"Bash(git add:*)",
"Bash(git status:*)",
"Bash(git commit:*)",
"Bash(git diff:*)",
"Bash(git log:*)",
]
---
# Claude Command: gwip
Analyze git diff and create a detailed WIP commit message.
First line: '🚧 wip: [concise description] [skip ci]'.
Then add a blank line and bullet points with more context about the changes, features worked on, files modified, etc.
Commit with --no-verify and --no-gpg-sign using multi-line message.
Do NOT push your changes
To keep your commits clean, add this to .claude/settings.local.json
to prevent Claude being added as a co-author:
{
"includeCoAuthoredBy": false
}
How It Works
When you run /gwip
, Claude Code will:
- Analyze your git diff to understand what changed
- Generate a commit message starting with
🚧 wip:
- Add detailed bullet points about the changes
- Create the commit with
--no-verify
and--no-gpg-sign
- Skip CI with
[skip ci]
in the message
Example Output
🚧 wip: implement user authentication flow [skip ci]
• Added login component with form validation
• Created authentication context provider
• Modified API routes to handle JWT tokens
• Updated user model with session management
• Work remaining: password reset functionality
Now I get my quick commits — saving snapshots in time without triggering CI — but with meaningful context provided by AI. No more archaeology sessions trying to figure out what past-me was thinking!
Thanks for reading!
If you enjoyed this post, I'd love to connect with you. Follow me on social media for more insights on development, entrepreneurship, and building in public.
Get more insights delivered to your inbox
Join my newsletter for weekly thoughts on tech, entrepreneurship, and building better products.