← All projects

differens

A diff engine that tells you what actually happened to your code: renamed, moved, extracted, reformatted, rather than which lines changed.

TypeScript ossl-dev/differens

Why it exists

Line diffs date back to the 1974 Unix diff and still do not know what the lines mean. Rename a function and you get a deletion plus an addition. Move a block across files and you get two unrelated chunks of noise. Reformat a file and the whole thing reads as changed, which leaves the thinking to you.

What it does

Differens parses both sides into trees with tree-sitter, matches nodes using a GumTree-lineage algorithm, and emits a typed edit script of insert, delete, update, and move. The pipeline is deterministic and runs no model anywhere, so the same inputs give the same narration every time. When something will not parse it degrades rather than failing: structural tree diff, then line diff, then changed or unchanged. Adapters cover JSON, YAML, TOML, INI, env files, and sixteen languages. It reads git history or two plain directories, so a repository is not required.