// blog / guide
How to diff two prompts: git, diff and the ple CLI compared
You changed a few words and the output changed a lot. Before guessing why, look at exactly which words moved.
1. git diff, at the word level
git diff --no-index compares any two files, with no repository needed. Prompts are prose, so ask for words, not lines.
git diff --no-index --word-diff=plain a.md b.md@@ -1,2 +1,2 @@
Review for bugs. {+Quote lines.+}
{{diff}}Added words are wrapped in {+ +} and removed ones in [- -]. The same flag works on commits: git diff --word-diff <old> <new> -- prompts/code-review.md. The layout around that is in how to version prompts in git.
2. Plain diff
diff -u a.md b.md@@ -1,2 +1,2 @@
-Review for bugs.
+Review for bugs. Quote lines.
{{diff}}Fine for a quick look, but it marks the whole line as changed, which hides how small the edit was.
3. ple diff, on saved versions
If the prompt is saved with the ple CLI, every revision is a numbered version, so you do not need two files. This works signed out, on your local history, with no network requests.
ple diff "code review" # previous version vs current
ple diff "code review" 1 3 # any two versions (3 or v3 both work)--- code review v1
+++ code review v3
@@ -1,1 +1,1 @@
-Review this diff for bugs, not style: {{diff}}
+Review this diff for bugs only. Quote the line for every finding. Say 'no findings' if clean. {{diff}}ple log "code review" lists the versions first, and ple rollback "code review" 1 brings one back as a new version. Output is plain when piped, or with --no-color.
4. In the browser, no install
The /try page does the same save, compare and roll back flow in a tab, with no sign-up. Its history lives in this browser's local storage and is not sent to our servers, so export it as JSON if you want to keep a copy.
Reading a prompt diff
- Change one thing at a time. If a diff has five edits, you cannot say which one mattered.
- Check the variables. A renamed or deleted
{{placeholder}}is a bug, not a wording change. - Pair every diff with an output. Run old and new on the same input; see test your prompts with your own agent.
- Write down why. A changelog entry takes a minute and saves the guessing later.
FAQ
How do I diff two prompts without a git repository?
Run git diff --no-index --word-diff=plain a.md b.md on any two files. You can also use the plain diff -u a.md b.md, which is available on macOS and Linux.
Why is a word diff better than a line diff for prompts?
A prompt is usually a few long lines of prose. A line diff marks the whole line changed when you add one sentence; a word diff marks only the words that moved.
How do I compare two saved versions of the same prompt?
With the ple CLI, ple diff <name> <a> <b> compares two versions, and ple diff <name> alone compares the previous version with the current one. References can be written as 3 or v3.
Can I diff prompts in the browser without installing anything?
Yes. The /try page lets you save versions and compare any two in your browser. Everything stays in this browser's local storage and is not sent to our servers.
Does a diff tell me which prompt is better?
No. It shows what changed. To find out whether the change helped, run both versions on the same inputs and compare the outputs.
Try it before you sign up
Save two versions of a prompt and diff them right now. It runs in your browser with no account, and nothing is sent to our servers.