# difftastic
> A structural diff tool that understands syntax

## Summary
A structural diff tool that understands syntax. Compares code based on AST structure rather than text lines, showing meaningful changes and ignoring formatting noise.

## Capabilities
- Syntax-aware diffing for 30+ languages
- Ignores formatting-only changes
- Side-by-side display with syntax highlighting
- Git integration as external diff tool

## When to Use
- Reviewing code changes where formatting was also modified
- Want to see meaningful structural changes, not whitespace diffs
- Using as a git difftool for code review

## When NOT to Use
- Need to diff non-code files (use standard diff)
- Diffing unsupported languages

## Usage Patterns
### Diff two files
```
difft old.py new.py
```
Shows structural differences between two Python files

### Use as git difftool
```
GIT_EXTERNAL_DIFF=difft git diff
```
Uses difftastic for git diff output

## Installation
- **homebrew**: `brew install difftastic`
- **cargo**: `cargo install difftastic`
- **pacman**: `sudo pacman -S difftastic`

## Related Tools
- [delta](/tools/delta) (alternative): delta enhances line-based diffs; difftastic does structural diffs

---
Source: https://littlescripts.sh/tools/difftastic
