Idea · Aug 30, 2026
LLM Diff
A CLI tool that compares two prompts or system-prompt versions by running both against a shared set of test inputs and producing a semantic diff showing exactly how outputs changed.
What it would do
Prompt engineering is now a first-class development activity, but developers have no equivalent of 'git diff' for understanding how a prompt change alters model behavior across a range of inputs. LLM Diff fixes this: you provide two prompt files (or two git-tracked versions of a system prompt) and a JSON test suite of sample inputs, and the tool runs both prompts against each input using the local claude CLI, then renders a side-by-side semantic diff. Columns show which test cases flipped (pass to fail or vice versa), which outputs changed length or tone, and which safety refusals appeared or disappeared. A summary header scores the change as a regression, improvement, or neutral refactor. The tool is designed to run in CI so prompt changes get the same review discipline as code changes: open a PR, CI runs LLM Diff against the golden test suite, and reviewers see the semantic delta before approving.
Key features
- Side-by-side output diff per test case with a pass/fail flip detector and overall regression/improvement summary
- Git integration: compare HEAD prompt against a branch version using 'llmdiff HEAD feature/new-system-prompt test-suite.json'
- CI mode that exits non-zero on regression (configurable threshold) so prompt PRs fail the build on output degradation
- Aggregate statistics: output length distribution, refusal rate, and format consistency score across all test cases