Commit Chronicles: Turning Git Obse

luyisi Beginner 5/31/2026 122 views 6 likes 2 min read

Our engineering lead used to spend an hour every Friday manually scrubbing the commit history before the weekly stakeholder demo because our developers write commit messages like "fixed bug" or "update." It was a mess of ambiguity that made auditing a nightmare. We decided to force a shift toward structured commits, but instead of just handing out a style guide that everyone would ignore, we integrated a local LLM hook to "clean" the messages before they hit the remote.

Commit Chronicles: Turning Git Obse

We settled on a combination of Claude 3.5 Sonnet for the initial prompt tuning and Ollama (Llama 3) running locally on the devs' machines to handle the actual pre-commit processing. The goal wasn't to let the AI write the code, but to translate "fixed the weird thing with the login" into "fix(auth): resolve race condition in OAuth2 token refresh loop."

The adoption process was surprisingly rocky. Our senior devs hated the feeling of an AI "correcting" their language. There was this weird ego clash where they felt the AI was stripping the nuance from their technical notes. To fix this, we didn't make the AI overwrite the message automatically. Instead, we set up a git hook that suggests a refined version and asks for a Y/N confirmation.

Here is the gist of the system prompt we’re using to keep the AI from getting too "flowery" (because nothing is worse than an AI adding "I have successfully updated the logic" to a commit):

You are a technical editor for Git commits. 
Convert the user's raw input into Conventional Commits format.
Rules:
- Format: <type>(<scope>): <description>
- Types: feat, fix, docs, style, refactor, perf, test, chore.
- No capitalization of the first letter of the description.
- No period at the end.
- Be concise. Do not use adjectives like "efficiently" or "improved."
- If the input is already compliant, return it exactly as is.

The speed gain isn't in the typing—it's in the retrieval. Three months in, our "searchability" has skyrocketed. When a regression hits, we can actually grep the logs for fix(api) and find the exact culprit in seconds rather than scrolling through a sea of "updates."

The main pushback now is "prompt drift." Every few weeks, someone finds a way to trick the hook or complains that the scope detection is wrong, which leads to a mini-debate in the Slack channel about whether a change is a refactor or a chore.

The tangible wins so far:
Audit time dropped from 60 minutes a week to about 5 minutes of spot-checking.
Onboarding for new hires is faster because the git history actually serves as a readable changelog.
Less friction during PR reviews since the "what did you actually change here?" questions have decreased.

We're currently experimenting with feeding the git diff into the prompt so the AI can suggest the commit message based on the code changes, but that's where the "too much automation" anxiety kicks back in. For now, keeping the human in the loop with a simple Y/N is the only way to keep the team from revolting.

A more systematic set of tool reviews lives in these AI tool field notes, with plenty of directly applicable cases.

All Replies (0)

No replies yet — be the first!

Write a Reply

Markdown supported