diffsitter is a semantic diff tool for source code.
Instead of comparing files purely as text, it parses code with tree-sitter and computes differences from the abstract syntax tree, which helps it ignore non-meaningful formatting changes such as spacing and layout. The project is designed for developers who want diffs that better reflect code structure, and it also offers configuration options for file associations, output formatting, and filtering the syntax nodes that take part in comparisons.
This is free and open source software.
Key Features
- Creates semantically meaningful diffs by comparing abstract syntax trees instead of raw text.
- Ignores purely formatting-related changes that don’t alter code meaning.
- Supports multiple languages through tree-sitter, including Bash, C#, C++, CSS, Go, Java, OCaml, PHP, Python, Ruby, Rust, Typescript/TSX, and HCL.
- Lets you configure file associations and formatting options with a config file.
- Supports include and exclude rules for tree-sitter node kinds so you can control which syntax nodes are considered in the diff.
- Offers terminal-aware formatted output.
- Includes extensive logging for debugging and timing information.
- Cross-platform support – runs under Linux, macOS, and Windows.
Website: github.com/afnanenayet/diffsitter
Support:
Developer: Afnan Enayet
License: MIT License

diffsitter is written in Rust. Learn Rust with our recommended free books and free tutorials.
Related Software
| Terminal-Based Diff Tools | |
|---|---|
| difftastic | Structural diff tool that compares files based on their syntax |
| diff-so-fancy | Attractive diffs with diff-highlight and more |
| delta | Viewer for git and diff output |
| icdiff | An improved colored diff |
| diffoscope | In-depth comparison of files, archives, and directories |
| colordiff | Wrapper for diff with pretty syntax highlighting |
| objdiff | Local diffing tool for decompilation project |
| ydiff | Tool to view colored, incremental diff in a version controlled workspace |
| diffr | Word-by-word diff highlighting utility |
| dyff | diff tool for YAML files |
| Wdiff | Wordwise implementation of diff |
| dwdiff | diff program that operates at the word level |
| diff2html-cli | Generate HTML diffs |
| dirdiff | Compute the differences between two directories |
| csv-diff | Diffing CSV and JSON files |
| csvdiff | Fast diff tool for comparing CSV files |
| sesdiff | Generates a shortest edit script |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

