AI Dev Hub

Prompt Version Diff

Diff two prompt versions line by line, with markers for template variables, XML tags and instruction keywords, plus added variables and token delta.

Prompt Version Diff

3 lines added, 1 lines removed

+3
Lines added
-1
Lines removed
2
Var changes
+27
Token delta (est.)
Variables changed
+ {{domain}}+ {domain}
Diff
-You are a helpful assistant.
+You are a helpful AI assistant specialized in {{domain}}.
var
Answer the user's question using the provided context.
Context: {{context}}
User question: {{question}}
+You must cite sources when available.
instruction
Always be concise and accurate.
Never make up information.
+Do not discuss topics outside {{domain}}.
varinstruction

Prompt-specific highlighting

varVariable changes

{{var}}, {var}, $var, ${var}

xmlXML tag changes

<tag>, </tag>, <self-closing/>

instructionInstruction keywords

must, never, always, do not, required...

1InputsPaste old prompt in left panel, new prompt in right panel. The tool highlights additions (green), deletions (red), and changed sections. Identify exactly what changed in your system prompt.
2Method
  1. Compare two AI prompt versions line-by-line
  2. Track prompt iteration for A/B testing
  3. Semantic diff: understand intent changes
  4. Audit prompt history for unintended creep
  5. Document safety/guardrail changes
3SourceAI Dev Hub’s Prompt Version Diff, computed in your browser.

Updated · Check the output before you rely on it.

How to use Prompt Version Diff

  1. Compare two AI prompt versions line-by-line

    Paste old prompt in left panel, new prompt in right panel. The tool highlights additions (green), deletions (red), and changed sections. Identify exactly what changed in your system prompt.

  2. Track prompt iteration for A/B testing

    Before running A/B test, document both prompts with the diff tool. Shows semantic changes (new instructions, removed constraints). When results differ, you know which changes caused it.

  3. Semantic diff: understand intent changes

    Variable changes, XML tag changes and instruction keywords (must, never, always, do not) are highlighted separately from ordinary text edits, so behavioral changes stand out.

  4. Audit prompt history for unintended creep

    Compare the original system prompt with the current version to see whether it has accumulated conflicting instructions or scope creep before you deploy.

  5. Document safety/guardrail changes

    If adding safety constraints to a prompt, use diff to highlight new guardrails. Archive the diff for compliance/audit logs. Shows exact when safety measures were introduced.

Questions and answers

Why not use a regular diff tool for prompts?
Regular diff tools miss prompt-specific changes like variable additions ({{new_var}}), XML tag restructuring (<system>/<context>), and behavioral instruction modifications (changes to 'must', 'never', 'always' rules).
What prompt variable formats are detected?
It detects {{variable}}, {variable}, $variable and ${variable} placeholders and lists which were added or removed between the two versions. A renamed variable appears as one removal plus one addition.
Does this tool track behavioral changes?
Yes. Changed lines containing instruction keywords such as must, never, always, do not, shall, required, important, ensure, forbidden or prohibited are marked as instruction changes, so you can see where the prompt's constraints moved.
Can I see token count differences?
Yes, each version shows its estimated token count with the delta highlighted. This helps you track prompt size growth across iterations.
Is this tool free and private?
Free to use. Your prompts are processed entirely in your browser and not sent to external servers. All diff computation happens client-side.
For AI agents: how to call this tool

The contract, endpoints and examples for calling this tool from code or an agent.

Best way to call it

Browser workflow

Runs in the browser tab; there is no HTTP endpoint. Open the tool page, run it and copy or download the result.

Page

/prompt-version-diff/

Its machine-readable contract is at /api/tool/prompt-version-diff.json.

esc
↑ ↓ move↵ open