Difftastic is a structural diff tool that compares files based on their syntax rather than line-by-line differences.
Difftastic solves the problem of diffs that obscure actual changes by treating code as syntax trees rather than sequences of lines. It parses files using tree-sitter to understand their structure, then compares the resulting abstract syntax trees. This approach means that reformatting code, moving expressions across lines, or changing indentation shows only the semantic changes that matter, not noise from whitespace or line breaks. When a file uses an unrecognized extension, the tool falls back to line-oriented diff with word highlighting.
Difftastic suits developers who want to review code changes with clarity, particularly in projects where formatting changes are frequent or where understanding the actual semantic diff matters more than seeing line-by-line edits. It integrates with git and other version control systems through configuration. The tool supports over thirty programming languages. It is not intended for generating patches to apply later, nor does it address AST-based merging; those remain separate concerns better handled by other tools.
The project experiences active development with regular releases that address crashes and robustness issues. Performance and memory usage scale poorly on files with large numbers of changes, which the maintainers acknowledge as a known limitation. The side-by-side display mode, while generally effective, can sometimes be confusing in certain scenarios. The tool is young and lacks integration with many external tools, though the maintainers welcome community contributions of plugins for popular editors and platforms.