Difftastic
$ difft Community Low Riskdifft compares files and directories by parsing syntax trees rather than naive line-by-line diffs, ignoring whitespace and formatting noise. Passing --display json emits structured AST change hunks cleanly for agent code review.
brew install difftastic Local Tree-sitter structural diffing runs directly via difft with zero RPC overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --display json (and DFT_DISPLAY=json), --color never, and --exit-code for semantic change detection.
- Native
--display jsonand--color neverflags
Strictly read-only local comparison tool with zero network or write actions.
- Pure read-only file diffing
Rust binary distributed via brew, cargo, and GitHub releases across macOS, Linux, and Windows.
- Cross-platform prebuilt binaries
Cuts through noisy reformatting diffs so agents focus on actual semantic AST edits.
- Tree-sitter parsing across 30+ languages
Actively maintained by Wilfred Hughes under MIT license.
- Well-established OSS repository
Dedicated manual at difftastic.wilfred.me.uk covering git integration and JSON display.
- Official user manual and
--helpreference
Security, Auth & Guardrails
None required; reads local files only.
100% free, offline, and open-source (MIT).
# difftastic (difft) Agent Rules - Pass `--display json` or `--display inline --color never` so side-by-side terminal columns do not scramble agent parsing. - Use `difft --exit-code` when automating semantic-change checks in CI.
Agent-Ready Command Recipes
Safe Read-Only Queries
difft --display json --color never old.ts new.ts
Emits JSON syntax-level changes while ignoring pure reformatting.
GIT_EXTERNAL_DIFF='difft --color=never' git diff HEAD~1
Reviews commit changes structurally without side-by-side ANSI noise.
Strengths for Agents
- + Strictly read-only structural diffing with
--display jsonoutput. - + Integrates seamlessly as
GIT_EXTERNAL_DIFFwithout modifying git history.
Caveats & Pitfalls
- ! Default side-by-side terminal layout is hard for LLMs to parse—always pass
--display jsonor--display inline. - ! Very large files can hit its parse graph memory limit and fall back to textual diff.