CodeDiff is a Rust-based syntax-aware diff tool that emphasizes speed, robustness, and precision for source-code changes. It uses tree-sitter grammars to produce fine-grained, semantic hunks (detecting moved code, partial-line edits, and enclosing function/class context) rather than whole-line churn. Performance claims include under 100 ms for 93% of changes and the ability to diff 99.95% of changes; accuracy metrics report 70% of diffs as perfect and 90% near-perfect. It supports 24 languages with text and binary fallbacks, presents changes in a two-pane terminal UI with 24-bit color when available, and includes a browser demo showing side-by-side comparisons with GNU diff.
Distribution and integration are comprehensive: build from source via cargo or install prebuilt binaries for Linux, macOS, and Windows; Homebrew, Debian/Ubuntu apt repo, Nix, Arch and Gentoo packaging are available. Usage modes include an interactive TUI, headless/batch output for CI, and structured JSON output for editor tooling (rows/columns are byte offsets, hunks carry operation types and reference lines). Git integration is provided (difftool backend and GIT_EXTERNAL_DIFF), and editor plugins exist or are planned (VS Code extension awaiting API, Neovim plugin). Headless defaults, color controls, context collapsing, and exit-code behavior are designed for scripting and VCS workflows.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.