A zero-dependency semantic diff engine and regression detector for AI agent system prompts, skills, and LLM instruction templates.
Standard git diff only cares about character changes. When working with AI coding agents:
- Adding a single casual paragraph can quietly add 300+ tokens to every single execution.
- Soft instructions ("Please do not forget...") weaken model steerability and cause silent hallucinations.
- Unintentional ALL-CAPS shouting degrades reasoning coherence.
prompt-diff evaluates prompt edits with token-budget deltas and automated prompt smell detection.
- Token Delta: Exact token count shift and percentage drift (
+45 tokens (+18%)). - Weak Negations: Flags phrases like "Don't forget to..." or "Never under any circumstances...".
- Pleading & Politeness: Flags filler tokens like "Please", "Kindly", "You are a helpful assistant".
- CoT Overuse: Flags unnecessary "Think step by step" triggers on models with native reasoning loops.
- Caps Shouting: Detects aggressive multi-word ALL CAPS bloat.
# Compare two prompt iterations
npx prompt-diff system_prompt_v1.md system_prompt_v2.md
# Output JSON for CI automated checks
npx prompt-diff prompt_base.txt prompt_pr.txt --jsonMIT © luckdevx