A convincing description can still be invented.
Yedhu Krishnan writes that drafting a commit body used to make him reread the code, summarize the change, and reconsider decisions. In agent-written code, he sees a new failure. The agent may know the diff but miss the reason scattered across conversations, project tools, or offline decisions. It can fill that gap with plausible reasoning.[1]
Giving the agent more context can reduce that error. It does not prove that the author understands the resulting code. Krishnan's practice is direct: he writes the commit description himself. If he cannot explain why the change exists, he does not understand what he is shipping.[1]
The commit body is useful before it becomes history. Writing it can expose a change you cannot yet defend.
Git records a message, not its truth.
The git commit documentation says a commit records the current index and a log message that describes the changes. It also offers --dry-run to summarize what the next commit would include and --patch to choose changes interactively.[2] Those controls help align the message with the actual patch. They do not check the reason in the prose.
Pro Git recommends logically separate changesets and useful messages. Its commit guideline asks for a concise subject, then a body that explains motivation and contrasts the new implementation with previous behavior.[3] The point is not a universal character-count ritual. The point is to leave a reviewable explanation attached to a bounded change.
The reason needs an owner.
Chris Beams distinguishes the diff from the message. The diff shows what changed. The message should explain the reason. His guide also says not every commit needs a body. A simple typo can stand on one line, while a consequential change needs context and side effects.[4]
An agent can draft that body. Keep the ownership clear. "Agent draft" means a person must challenge each factual claim and supply the missing project decision. "Human writes" means the person owns the words but still checks them against the staged patch. "Team review" means the explanation is examined with the code.
Make temporary decisions admit that they are temporary.
Krishnan calls out sentences such as "I am doing this until we..." because they capture exit criteria that may not exist in code or project tools.[1] That small sentence prevents a workaround from becoming permanent through silence.
- State the user-visible or system behavior that changed.
- Name the project reason. Do not infer it from the patch.
- Record the cost, rejected option, or condition the change accepts.
- Write the event that should trigger removal or reconsideration.
- Compare every sentence with the staged diff before committing.