ashlr__diff
Token-efficient git diff. Adaptive compression — stat for large patches, summary for medium, full for small.
Server: ashlr-diff — servers/diff-server.ts
Returns compact summaries instead of full patches when the diff is large. Three modes, one adaptive:
| Mode | When it fires | Output |
|---|---|---|
stat | Raw patch > 500 added+deleted lines | Files + line counts only |
summary | 100–500 lines | Stat + hottest hunks |
full | < 100 lines | Raw patch, snipCompact-truncated if > 4 KB |
The default mode is auto — it picks the right level based on patch size.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
ref | string | no | Git ref to diff against (default: HEAD~1). Also accepts 'staged' / 'unstaged' / 'working'. |
path | string | no | Limit to path(s); file or dir |
cwd | string | no | |
mode | string | no | auto, stat, summary, or full |
bypassSummary | boolean | no | If true, skip LLM summarization and return the full compacted diff. |
Output format
Stat mode:
Example
Savings baseline
A 30K-line refactor across 40 files returns in ~200 tokens (stat mode) vs ~90K tokens raw.
Related tools
ashlr__diff_semantic— AST-aware variant for rename/refactor detection