Matthew Boston

I Got Tired of Writing Bad Commit Messages

December 5, 2025

The Problem with Commit Messages

We all know what good commit messages look like. Conventional format, present tense, focused on why not what. We’ve all read the blog posts and nodded along. And then we finish a three-hour debugging session and type fix stuff because our brains are fried.

The gap between knowing what a good commit message looks like and consistently writing one is discipline — the kind that’s hardest to maintain when you need it most. After a deep focus session, the last thing you want to do is context-switch to writing clear prose about what you just did.

Let the Diff Speak for Itself

The insight behind git ai-commit is simple: the staged diff already contains everything needed to write a good commit message. The changes are right there — what was added, what was removed, what was modified. An LLM can read that diff and generate a conventional commit message that’s better than what most of us write by hand, especially at the end of a long day.

It examines your staged changes, understands the intent behind them, and produces a commit message that follows conventional commit format. No more fix stuff. No more update code. No more staring at the terminal trying to summarize two hours of work in one line.

Meeting You Where You Work

The real win came when I integrated it with Emacs and magit-mode. A keybinding — C-c C-a — and the commit message appears in the buffer, ready to review and edit. No context switch. No separate terminal. It’s just part of the flow.

That’s the design principle: AI tools should meet you where you already work, not ask you to change your workflow. The best developer tools are invisible. They reduce friction at the exact moment friction appears, and then get out of the way.

Not a Replacement for Thinking

This isn’t about removing humans from the commit process. You still review the message. You still edit it if it’s wrong. You still decide what gets staged and what doesn’t. The tool handles the mechanical part — translating a diff into prose — so you can focus on the judgment calls.

The best commit messages tell a story about why a change was made. The diff tells you what changed. Bridging that gap is where git ai-commit helps, but the why still comes from you.

Try It Yourself

The scripts are in my dotfiles:

  • git-ai-commit-msg — the core engine. It reads your staged diff and recent commit history, sends them to Claude, and outputs a conventional commit message to stdout. Non-interactive, no side effects — just a message. This is the script you can wire into hooks, editor integrations, or any automation.
  • git-ai-commit — the interactive wrapper. It calls git-ai-commit-msg under the hood, displays the generated message, and prompts you to accept, edit, or reject it before committing. This is the one you use from the command line as git ai-commit.

Drop them in your $PATH and Git picks them up as subcommands automatically.


This article was originally posted on LinkedIn.