Prompts / Commit message from a diff
Commit message from a diff
Write a commit message that explains why a change was made, not just a restatement of the diff.
Copying runs entirely in your browser - nothing here is ever sent anywhere.
Fill in the variables
Write a commit message for this diff.
Extra context on why this change is happening (a ticket, a bug report, a
conversation) that might not be obvious from the diff alone: {{context}}
Rules:
- Subject line under 72 characters, imperative mood ("Fix", not "Fixed" or
"Fixes"), no trailing period.
- The body explains why this change was made, not a line-by-line
restatement of what changed - the diff already shows what changed.
- If the diff mixes an unrelated change in with the main one (a drive-by
formatting fix, an unrelated typo), call that out rather than writing a
message that pretends it's all one coherent change.
- If you genuinely can't tell why a change was made from the diff and
context given, say what's missing rather than inventing a plausible-
sounding reason.
Diff:
{{diff}}
When to use
Right before committing, especially for a change whose motivation lives in your head or a ticket rather than in the code itself. Also good for tidying up a WIP commit’s message before it becomes part of permanent history.
Why it works
The most common bad commit message either restates the diff (“update user.py”) or gives no reasoning at all. Explicitly separating “what changed” (which the diff already shows) from “why” (which it usually doesn’t) produces a message that’s actually useful to someone reading the log in six months. Flagging mixed/unrelated changes catches a commit that should really be two commits.
Variations
- Add “Format as a Conventional Commit (feat/fix/chore: …)” if your repo uses that convention.
- For a squash-merge PR, ask for a message that summarizes the whole branch rather than any single commit - paste the full PR diff instead.
- Ask “What would a reviewer most want explained about this change that isn’t obvious from the diff?” as a check before finalizing.