Prompt Diff
Compare system prompts, AGENTS.md, CLAUDE.md, or Cursor rules. Live side-by-side highlights. Free and private.
Before
After
How to Use
- 1Paste the previous prompt/rules on the left and the candidate on the right.
- 2Use line mode for markdown files; word mode for paragraph prompts.
- 3Switch split vs unified depending on how you review Git diffs.
- 4Download the patch, then run the Prompt Linter on the final version.
Typical uses
Prompt iteration
v1 system prompt → v2 with safety + formatCatch accidental deletions of hard constraints.
Rules PR review
AGENTS.md before/after a stack changeSee whether MCP or safety sections were dropped.
Tips
- •Diff against the last shipped prompt, not a draft. Fewer false changes.
- •If similarity is high but intent changed, switch to word mode.
- •Keep critical “never / always” lines near the top so diffs stay readable.
- •After merging, lint the result for contradictions the diff won’t catch.
How this diff works
The page wraps the diff package. In line mode it calls diffLines; in word mode it calls diffWords. Both use a Myers diff to find the longest common subsequence, then return a list of removed, added, and unchanged hunks. The split view pairs removed and added hunks row by row. The stats count characters, not lines: added, removed, unchanged, and a similarity score equal to unchanged characters divided by the total. The unified view comes from createTwoFilesPatch with three lines of context.
Everything runs in the browser. The prompt or rules text is never uploaded, and no AI model is involved, so the comparison is deterministic: the same two inputs produce the same diff every time.
A real diff
A run on 2026-11-16 with the built-in sample prompts, line mode:
| Measure | Result |
|---|---|
| Added characters | 318 |
| Removed characters | 154 |
| Unchanged characters | 2 |
| Similarity | 0% |
-You are a helpful coding assistant. +You are a careful coding assistant for this Next.js monorepo. -Be nice and write high-quality code as needed. -Always be thorough. Always be concise. +## Rules +- Prefer TypeScript strict mode. +- Make small, focused diffs. +- Never commit secrets or `.env` files.
Similarity is 0 because nearly every character changed, even though both files describe a coding assistant. The number measures text overlap, not intent. That is why the diff view matters more than the score.
What it cannot tell you
- Similarity is character-based. A small edit to a long file barely moves it, and a rewrite of a short file drops it to zero.
- Line mode treats a reflowed paragraph as a whole-line change. Word mode shows smaller edits but is noisier on long files.
- There is no syntax awareness. A moved section appears as a deletion plus an addition, and a changed
.mdcfrontmatter value is just a line. - It cannot say which version is better, safer, or more likely to work.
- The patch context is fixed at three lines, which can hide nearby rules.
- It compares two texts at a time, not a version history.
When to use something else
- For general text comparison, use Text Diff.
- To score the result for clarity, safety, and contradictions, use the Prompt & Rules Linter.
- To generate a starting rules file, use the Cursor Rules Generator.
- For committed repository history, use Git. This tool is for prompt revisions.
Frequently Asked Questions
What is Prompt Diff for?
It compares two versions of a system prompt, AGENTS.md, CLAUDE.md, or Cursor rules file so you can see exactly what changed before shipping agent instructions.
How is this different from the Text Diff tool?
Same Myers algorithm as Text Diff, with extras for prompt and rules work: live diff, word or line mode, sample prompts, patch download, and links to the Prompt Linter.
Does my prompt leave the browser?
No. Diffing runs in your browser.
Line vs word mode?
Line mode suits markdown rule files. Word mode shows edits inside a line, which helps with long prompt paragraphs.
Can I download a Git-style patch?
Yes. Download the unified patch and review it in PRs or commit it next to your rules.
Is it free?
Yes. No signup and no watermark.
Why is similarity 0% when both prompts mean the same thing?
Similarity is the share of unchanged characters, not a measure of meaning. A rewritten opening and new section headings replace most of the text, so the number drops even when the intent is the same.
Does it parse Markdown or Cursor .mdc frontmatter?
No. It compares plain text lines or words. Frontmatter is treated as ordinary lines, so a changed description or globs value shows up as a normal line edit.
Can I compare more than two versions at once?
No. It compares two texts at a time. Compare v1 with v2, then v2 with v3, and read the patches in order.
Related Tools
Prompt & Rules Linter
Score clarity, safety, and contradictions
Cursor Rules Generator
Generate AGENTS.md and .mdc starters
Text Diff Checker
General-purpose text comparison
Token Counter
See how edits change token cost
MCP Tool Checker
Score agent tool schemas
Prompt Diff
Compare system prompts and agent rules side-by-side