Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've also found it good at catching mistakes and helping write commit messages.

"Review the top-most commit. Did I make any mistakes? Did I leave anything out of the commit message?"

Sometimes I let it write the message for me:

"Write a new commit message for the current commit."

I've had to tell it how to write commit messages though. It likes to offer subjective opinions, use superlatives and guess at why something was done. I've had to tell it to cut that out: "Summarize what has changes. Be concise but thorough. Avoid adjective and superlatives. Use imperative mood."



This is insane to me.

Review your own code. Understand why you made the changes. And then clearly describe why you made them. If you can't do that yourself, I think that's a huge gap in your own skills.

Making something else do it means you don't internalize the changes that you made.


Your comment is not a fair interpretation of what I wrote.

For the record, I write better and more detailed commit messages than almost anyone I know across a decades[^0] long career[^1,^2,^3,^4,^5]. But I'm not immune from making mistakes, and everyone can use an editor, or just runs out of mental energy. Unfortunately, I find it hard to get decent PR reviews from my colleagues at work.

So yeah, I've started using Claude Code to help review my own commits. That doesn't mean I don't understand my changes or that I don't know why I made them. And CC is good at banging out a first draft of a commit message. It's also good at catching tiny logic errors that slip through tests and human review. Surprisingly good. You should try it.

I have plenty of criticisms for CC too. I'm not sure it's actually saving me any time. I've spent the last two weeks working 10 hour days with it. For some things it shines. For other things, I would've been better off writing the code from scratch myself, something I've had to do maybe 40% of the time now.

[^0]: https://seclists.org/bugtraq/1998/Jul/172

[^1]: https://github.com/git/git/commit/441adf0ccf571a9fe15658fdfc...

[^2]: https://github.com/git/git/commit/cacfc09ba82bfc6b0e1c047247...

[^3]: https://github.com/fastlane/fastlane/pull/21644

[^4]: https://github.com/CocoaPods/Core/pull/741

[^5]: None of the these are my best examples, just the ones I found quickly. Most of my commit messages are obviously locked away by my employer. Somewhere in the git history is a paragraphs long commit message from Jeff King (peff) explaining a one line diff. That's probably my favorite commit message of all time. But I also know that at work I've got a message somewhere explaining a single character diff.


What I can recommend is to tell it that for all documentation, readmes and PR descriptions to keep it "tight, no purple-prose, no emojis". That cuts everything down nicely to to-the-point docs without GPTisms and without the emoji storm that makes it look like yet another frontend framework Readme.


How long are you commit messages if you still are ahead after typing all this prompt?


My commits’description part, if warranted, is about the reason for the changes, not the specificity of the solution. It’s a little memo to the person reading the diff, not a long monograph. And the diff is usually small.


This is a good call! Do you have claude use atomic commits or do you manually copy/paste the output?

Saving your summary instructions as a CLAUDE.md


I'll tell it to commit or amend depending upon the situation. Then I'll open the message in my editor and revise what it wrote.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: