Prompt Drift
Catch silently degrading prompts
npx promptreports-cli prompts auditWalks lib/ and app/api/ to find LLM call sites. Checks git history for modifications. Flags deprecated models.
prompts audit is a static analyzer for your LLM integrations. It finds every place your code calls Anthropic/OpenAI/OpenRouter (system prompts, user prompts, tool definitions), cross-references with git history to flag recently changed prompts (highest drift risk), identifies deprecated models (gpt-3.5-turbo, claude-3-opus, claude-3-5-sonnet-old), and flags oversized system prompts (>800 tokens).
On this page
Prerequisites
- lib/ and app/api/ directories
- Git repo
Flags & Options
| Flag | Description | Default |
|---|---|---|
| --days N | Recent-change lookback | 7 |
| --json | JSON output | — |
Examples
Audit everything
npx promptreports-cli prompts auditEvery LLM call in your codebase.
30-day drift
npx promptreports-cli prompts audit --days 30What prompts changed last month?
Output
Total call site count + recently changed (with git hash + commit subject) + model mismatches + token waste (oversized prompts).
18 LLM call sites found across 5 files
CHANGED RECENTLY (last 7 days):
lib/ai/chat.ts:42
a3b4c5d2 "fix: update claude-3.5-sonnet model"
Model: claude-3-5-sonnet-20241022 → claude-sonnet-4-6
lib/ai/generate.ts:89
c5d6e7f8 "feat: add streaming support"
System prompt: +240 tokens
MODEL MISMATCHES (deprecated or outdated):
lib/ai/legacy.ts:12 — gpt-3.5-turbo (deprecated Sep 2025)
lib/ai/fallback.ts:23 — claude-3-opus (replaced by claude-opus-4)
TOKEN WASTE (prompts > 800 tokens):
lib/ai/analyze.ts:78 — ~1,200 tokens (consider trimming)
lib/ai/summarize.ts:34 — ~950 tokensWhat it reads and writes
Reads
- lib/**/*.ts
- lib/**/*.tsx
- app/api/**/*.ts
- app/api/**/*.tsx
- git log
Writes
Nothing (read-only)
Free vs Pro usage
Free tier
- Find deprecated models before they break
- Spot prompt drift during code review
- Document all LLM call sites for security audit
Pro tier
Upgrade- Auto-open PRs to update deprecated models
- Prompt quality scoring — test every prompt against golden examples
- Prompt version control with rollback
- A/B test prompt variants in production
Pro tips
- Run before every major deploy
- Pair with `costs --by model` to find models to swap
- System prompts > 800 tokens are a smell — extract to tools or skills