Commit description as a thinking tool

Hacker News Top News

Summary

作者认为在 AI 代理编码时代,开发者应自己撰写 commit 描述,把它当作反思与理解代码的思维工具,以避免 AI 编造错误的“为什么”并确认自己真正理解所交付的更改。

No content available
Original Article
View Cached Full Text

Cached at: 09/30/26, 08:04 PM

# Commit Description as a Thinking Tool Source: [https://yedhu.me/posts/commit-description-as-a-thinking-tool/](https://yedhu.me/posts/commit-description-as-a-thinking-tool/) Before the AI era, I wrote pretty long commit descriptions \(or commit bodies\) for major changes\. It took me about five to ten minutes to draft and reread them to make sure I didn’t miss anything important\. I did that for several reasons\. I wanted to include all the useful information so readers wouldn’t have to hunt for it in multiple places\. I wanted to explain what and, more importantly, why\. The “what” summarizes the changes that are generally self\-explanatory, but it gives a starting point for explaining the “why\.” Sometimes, I write it in first person, like I am drafting a message for someone: “I did this because…”, “I am doing this until we…” etc\. I then go ahead and explain why, so that it is easier for others, and most importantly for my future self, to understand why we made that change\. It was a good exercise\. It wasn’t just about writing the commit message and description\. The writing process itself helps me reflect on the code I wrote\. I reread the code and summarize the changes\. During that process, I tend to re\-evaluate the decisions, and sometimes that leads to a different or better change\. Now we are in the era of agentic coding, where everything from code to commit descriptions is written by AI\. There is a huge debate on whether we should read the AI\-written code, and how difficult that is in terms of readability\. The part I find difficult is reading and understanding AI\-written commit descriptions\. Agents can write commit messages for the changes they make\. But they may not have the full context that is spread across different communication and project management tools\. Some of those might be offline too\. When the AI doesn’t know the ‘why’ part, it comes up with its own reasoning\. I find that dangerous\. When we read that later, it may not make sense, because the real reason was completely different\. One obvious solution is to give the agent all the context it needs, through chat or tools\. This helps to fix the issues with fabricated reasoning\. The agent can now explain the “why” clearly\. But this doesn’t fix the other problem\. The agent with the right context will write a convincing commit message\. But only I can verify if the code does what the description says\. So, here is something I do: Write the commit message and description myself\. Here is why\. Writing a commit description myself helps me to reflect on the changes AI made\. It is also a way to check if everything is as intended\. If I cannot explain “why,” I am shipping something I don’t understand, which will be hard to explain or fix if it breaks later\. It goes back to the old quote\. If you cannot explain it, you did not understand it\. The commit description again works here as a thinking tool\. Some parts, like “I am doing this until we…”, are temporary decisions with exit criteria\. We sometimes set exit conditions, and AI cannot infer them from code or other tools because they are usually not written down anywhere since they seem too obvious to mention\. But writing the commit message forces me to complete that sentence, and it helps future readers decide whether to keep that change\. The agent can write the code and the description\. But writing why is where you find out whether you understand what you are shipping\.

Similar Articles

@dotey: https://x.com/dotey/status/2055097242755706984

X AI KOLs Timeline

Senior developers often fail to communicate effectively with business teams because they overemphasize code complexity, while business teams truly care about eliminating uncertainty. The article suggests developers use "Can we try a faster approach?" to align both sides, and points out that although AI can write code quickly, humans still take responsibility.

@feltanimalworld: Master, your post kept me pondering for two whole days! I originally wanted to write a long piece, but there were too many threads and I didn't know where to start. To sum it up, this is why I've been on Twitter lately—I felt something crucial was missing in my development understanding; it's also why, besides my hardware repair work, I've had to look into text-to-CAD recently. I...

X AI KOLs Timeline

The author discusses the lack of intermediate representation (IR) and verifier in the deployment of AI in serious industries, using text-to-CAD as an example to illustrate the key role of unified IR and verification in the feasibility of AI solutions.

@Ryrenz: Most people using coding AI just say “help me fix this bug,” then spend half an hour wrestling with it. Change the phrasing and it gets it right the first time. 1. Have it look before acting “Don't write code yet. Read the relevant files and tell me how this feature currently works; I'll confirm before you change it.” 2. Stuck bug “Don't guess. Add log…

X AI KOLs Timeline

A practical tip on how to use coding AI more effectively. It lists 12 concrete prompt examples—such as having the AI read the code before modifying it, changing only the necessary parts, and writing rules into AGENTS.md—to reduce back-and-forth and make the rules stick long-term.

@AYi_AInotes: Say a hot take: In the AI era, the most valuable skill is no longer writing code. Being able to explain code clearly will become increasingly important! Becoming increasingly important! @trq212, a senior engineer on the Anthropic Claude Code team, took less than two years to make his technical articles reach stable...

X AI KOLs Timeline

This article explores the importance of technical writing in the AI era, citing the case of Anthropic employee @trq212 who achieved millions of page views through his 'plant first, harvest later' writing methodology, emphasizing the value of sharing real experiences and maintaining a personal voice.