Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Difftastic

$ difft Community Low Risk
Wilfred Hughes (OSS) · Files & Search · MIT · macos / linux / windows

difft 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.

FCRS-1.0 Score
89 /100
Good
Medium Confidence
Zero-Friction Install
brew install difftastic
CLI vs MCP Decision CLI Preferred vs MCP

Local Tree-sitter structural diffing runs directly via difft with zero RPC overhead.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Supports --display json (and DFT_DISPLAY=json), --color never, and --exit-code for semantic change detection.

  • Native --display json and --color never flags
Trust & Safety 25 / 25

Strictly read-only local comparison tool with zero network or write actions.

  • Pure read-only file diffing
Setup & Portability 13 / 15

Rust binary distributed via brew, cargo, and GitHub releases across macOS, Linux, and Windows.

  • Cross-platform prebuilt binaries
Utility & Efficiency 13 / 15

Cuts through noisy reformatting diffs so agents focus on actual semantic AST edits.

  • Tree-sitter parsing across 30+ languages
Maintenance & Lineage 8 / 10

Actively maintained by Wilfred Hughes under MIT license.

  • Well-established OSS repository
Docs & Verifiability 8 / 10

Dedicated manual at difftastic.wilfred.me.uk covering git integration and JSON display.

  • Official user manual and --help reference

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; reads local files only.

Side Effects
Read-Only
Cost & Quotas

100% free, offline, and open-source (MIT).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Compare two files with structured JSON diff output
difft --display json --color never old.ts new.ts

Emits JSON syntax-level changes while ignoring pure reformatting.

Run structural diff via git external diff
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 json output.
  • + Integrates seamlessly as GIT_EXTERNAL_DIFF without modifying git history.

Caveats & Pitfalls

  • ! Default side-by-side terminal layout is hard for LLMs to parse—always pass --display json or --display inline.
  • ! Very large files can hit its parse graph memory limit and fall back to textual diff.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI