Semantic diff vs normal Git diff.
A normal Git diff shows line-level text changes. A semantic diff tries to show structural intent: moved code, reordered blocks, and meaningful changes that a patch view can make noisy.
Normal Git diff
Best for exact patches, small edits, generated files, unsupported languages, and the final truth of what Git will store.
Semantic diff
Best when code moved, declarations changed, functions were extracted, or review needs structure instead of line churn.
Fallback matters
Semantic analysis is not universal. A trustworthy tool must say when it falls back to a normal diff.
When semantic diff helps most
- A function moved inside a file and the patch looks like a delete plus an add.
- A refactor changed call sites in many places but only a few concepts changed.
- An import block or object literal was reordered and line diff overstates the change.
- A reviewer needs to separate formatting churn from logic changes.
When normal Git diff is still better
Plain diffs are universal, deterministic, and close to the patch that will be committed. They are the right view for unsupported file types, binary placeholders, generated artifacts, lockfiles, exact whitespace review, and any case where the semantic parser cannot confidently model the file.
Structural review without hiding the patch.
I ship tree-sitter structural diffs for more than 60 languages in the desktop app, with a labeled fallback to
the plain Git patch when parsing fails. When an AI agent proposes a change, the approval card opens with the
structural summary first, so you review what the change does before reading any lines. Over MCP,
diff.semantic was a contract before it was a payload, and as of 0.3.1 it is both: with FluxGit
running, agents get the real structural payload with per-file hunks, changed tokens and honest per-file
fallback reasons; standalone, it still returns supported: false plus the exact arguments for a
text-diff fallback, so an agent can never present a text patch as semantic. The honesty shipped first; the
capability followed.