diff
Compare two files side by side and get a unified diff with semantic similarity score. Reuses cached content to reduce token consumption.
Instructions
Compare two files side by side and return a unified diff.
Use this for explicit file-to-file comparison. For "what changed since I
last read this file?", use read instead of diff.
Behavior:
Returns unified diff plus semantic similarity score.
Reuses cached content when possible.
Large diffs may be suppressed to stay within token budget.
Args: path1: First file path. path2: Second file path. context_lines: Number of context lines to include around changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path1 | Yes | ||
| path2 | Yes | ||
| context_lines | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| truncated | No | ||
| path1 | No | ||
| path2 | No | ||
| diff | No | ||
| diff_state | No | ||
| diff_omitted | No | ||
| similarity | No | ||
| diff_stats | No | ||
| tokens_saved | No | ||
| from_cache | No | ||
| context_lines | No |