See what a rename looks like
The function below keeps its body and gets a clearer name:Follow code between files
Supposesrc/utils.ts and src/pricing.ts both exist. You move formatPrice
from the first file to the second, leaving the other declarations in place.
Compare snapshots of the two directories:
differens main..feature.
Modified moves are supported too: the declaration must keep its name and pass
the similarity check. Moving and renaming a function at the same time may leave
an addition and a removal. A reported move describes the matching evidence;
review the source to check behavior.
Read configuration edits by name
Changing a nested value does not require reading the whole document:1 to string "1" is a change,
even though the displayed characters look similar.
Give an agent a compact change report
Use--format=llm to include names and source lines. For the function rename above:
The same rename in Markdown looks like this:
Where it helps
Code review
Start with named changes to see which functions, classes, or settings need attention. Related body edits are grouped under their declaration. Use the source or a line diff when you need the exact text behind a summary.Refactoring across files
Compare a whole changeset to find supported declaration and file moves, including moves with edits. Helper extraction appears as a new helper and edits to the original declaration; the Go example shows that report.AI agents and coding assistants
Use--format=llm for an overview with source locations, or JSON when an
integration needs the original actions. The output gives an agent specific names
and files to investigate without asking it to reconstruct every change from hunks.
PR descriptions and changelogs
Rundifferens main..feature --format=markdown for a starting draft grouped by
file. Review the result and add the reason for the change, which syntax matching
cannot tell you.
Config and data reviews
Read named keys and values in structured files. Type changes, nested YAML edits, and markup attributes such ashref remain visible in the comparison.
Docs and prose
Plain text and logs support word edits and paragraph moves. Markdown uses line comparison. Source code, data, markup, prose, raw text, and binary files each have an adapter suited to their content; see the tier guide.CI and automation
JSON and NDJSON expose deterministic actions for scripts to inspect. Comparisons with changes exit zero; your script decides which changes should fail a check. For reports throughgit diff, install the Git driver.
How it works
- Parse each file with its code, data, markup, or text adapter.
- Match the trees to find updates, additions, removals, and moves.
- Correlate additions and removals across files to find supported moves.
- Describe the edits and format the report for a person or a program.
differens languages to check the
extensions in your build. Unsupported formats and inputs that exceed semantic
analysis budgets use line comparison. Read the language guide
for coverage and the architecture for the details.
Try it on your own changes
Install Differens, then run it inside a Git repository to compare staged, unstaged, and untracked files againstHEAD: