claude-dejavu
Stop Claude from fabricating names. Restore deleted sessions. Search every past conversation.
Built by HTE Switzerland — a digital solutions partner shipping production AI infrastructure, full-stack development, and cloud-grade engineering.

What claude-dejavu does
Every Claude API call costs tokens. Every fabricated name (a made-up env var, a wrong field on a Prisma model, a typo of a route, a fictional GraphQL field) ends in a rewrite — and a second API call to fix the first one. claude-dejavu catches those fabrications BEFORE they hit disk.
Twelve languages, eight grounding domains: symbols (Python, TypeScript, TSX, JavaScript, Go, Rust, Java, Ruby, Bash, PHP, C#, Kotlin), HTTP routes, frontend pages, env vars (with an SDK convention catalog covering LaunchDarkly / AWS / Stripe / Sentry / Redis / Postgres / Next / Datadog / OpenAI / Anthropic / Supabase / …), DB schema (Prisma / Drizzle / TypeORM / SQL migrations), GraphQL (SDL + inline gql), feature flags (LaunchDarkly / Unleash / GrowthBook / flags.json), plus an LSP wire-protocol passthrough for type-check ground truth.
89.3% measured reduction in hallucinated identifiers. On a 400-trial controlled benchmark against claude-sonnet-4-6 (51.5% → 5.5%, McNemar exact p=9.6e-27, 95% CI 82.7–95.1%), claude-dejavu's grounding cuts fabricated names by 89.3%. In additional tests with v0.5.0a's 14-strategy deterministic rewriter cascade (n=200, same prompts and scoring), we've measured up to 99% reduction (51.5% → 0.5%) — that's the upper bound seen so far, not a stability guarantee. Treat 89.3% as the rigorous headline. See docs/REWRITER.md for the rewriter architecture and docs/benchmarks/ for both reports.
Plus session recovery. Claude Code stores every conversation in ~/.claude/projects/<encoded>/<uuid>.jsonl. Those files can be deleted, truncated, or otherwise lost — by Claude, by a stray git clean, by manual cleanup. claude-dejavu mirrors them so deletion never costs you the conversation. Semantic search across every past chat means "have we discussed X before?" now has an answer.
Both ship as a Claude Code plugin AND a standalone CLI:
1. Recover deleted sessions
Every Claude Code Stop event mirrors the live .jsonl to an off-tree location. When a session disappears from ~/.claude/projects/, the next time Claude Code runs you see this:
⚠ claude-dejavu: 3 session(s) missing from ~/.claude/projects/. Run claude-dejavu restore --list to see all.
Then one command brings them back, byte-perfect, with a runnable claude --resume command:
$ claude-dejavu restore --list
Restorable sessions (3):
deleted aaaaaaaa-1111-0000-0000-000000000001 myproject 2026-04-15 124.7 MB
deleted aaaaaaaa-2222-0000-0000-000000000002 myproject 2026-04-08 25.3 MB
deleted aaaaaaaa-3333-0000-0000-000000000003 other-app 2026-04-02 0.9 MB
$ claude-dejavu restore --all
✓ aaaaaaaa-1111-… (124.7 MB) → ~/.claude/projects/-home-…/aaaaaaaa-1111-….jsonl
resume: cd ~/projects/myproject && claude --resume aaaaaaaa-1111-…
✓ aaaaaaaa-2222-… ( 25.3 MB)
✓ aaaaaaaa-3333-… ( 0.9 MB)
Restored 3/3 session(s).
2. Search across every past conversation
Hybrid BM25 + vector search across every turn of every past session. By default returns ~80-token gists; expand specific turns on demand to keep token cost low.
$ claude-dejavu search "auth refresh token rotation"
scope=ws:my-stack hits=2
[1] turn=1842 score=0.84 myproject/aaaaaaaa-1111 2026-04-15
Refresh-token rotation: store hash, single-use, 5min grace window for clock skew…
[2] turn=2104 score=0.61 backend/bbbbbbbb-2222 2026-04-12
JWT exp 15m + refresh 30d, rotation on every use, revocation list in Redis…
Claude can call this automatically through the bundled MCP server, so when you ask "have we discussed auth?" mid-session, it grounds itself in your actual past conversations instead of inventing context.
3. Auditable history