# Repository Briefing: vshulcz/deja-vu
> Source: https://repoforai.com/repo/vshulcz/deja-vu (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/vshulcz/deja-vu
- **Official Docs / Website**: https://vshulcz.github.io/deja-vu/
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Go
- **License**: MIT
- **Engineering Health**: A+ (92/100 · Maintenance 35/35 · Adoption 17/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.25.3 (2026-12-02) — https://github.com/vshulcz/deja-vu/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, MCP, Local AI, CLI, Self-Hosted
- **Momentum**: 1,728 ★ total (+5 24h / +50 7d) · 193 forks
- **Topics**: `agent-memory`, `claude-code`, `claude-code-hooks`, `claude-code-memory`, `cline`, `codex`, `codex-memory`, `cursor`, `cursor-mcp`, `dsh-plugin`, `gemini-cli-extension`, `kimi-code`
- **When to Use**: Best for: Developers who switch between coding agents, lose context during compaction, or need to recover uncommitted work from local transcripts. Teams can also share reviewed decisions through Git without sharing raw logs. Skip if: Native history already meets your needs, your primary client does not expose readable local transcripts, or you require one centrally managed archive of raw sessions.

## Overview
```text
### Architecture & Core Mechanics
Déjà vu is a Go CLI and self-hosted MCP server that indexes the transcripts coding agents already write to local JSONL and SQLite stores. Its append-only inverted index lives under `~/.cache/deja`. An append-only `records.bin`, token-bucket overlays, and watermarks in `manifest.gob` support incremental refreshes. The CLI, TUI, MCP server, and lifecycle hooks share that index rather than requiring separate history stores for each client.

The entry point is `./cmd/deja`; `go.mod` declares Go 1.25. The root npm manifest packages the DeepSeek Harness integration via `@vshulcz/deja-vu`; Node 18+ is a requirement for that package, not for running the Go binary. The default `deja mcp` server exposes one mode-dispatched `deja` tool over stdio. A separate `--context-search` mode serves Qwen Code’s External Context MCP profile.

### Key Capabilities & Differentiators
Search combines lexical matching with transcript structure and supports scoping by project, agent, date, and role. Integrations span 53 coding clients, but transcript ingestion, automatic recall, and native resume are not uniform. For example, TRAE IDE’s encrypted database is not ingested even though MCP and skills can be wired. Compaction hooks carry forward tasks, decisions, files, and verification commands; cross-agent handoff packages the goal, constraints, touched files, passed checks, and remaining work.

`restore` recovers overwritten code from recorded edit spans; `blame` ties lines to sessions, while `origin` maps commits or ranges and distinguishes attributed, uncertain, and unknown results. Recall payloads are capped at 4 KB. Benchmark results include 0.7–0.8 ms for in-process lookups and 88.9% hit@1 on the cleaned 470-question LongMemEval-S set. Neither figure measures end-to-end client latency or guarantees recall quality on a particular team’s history.

### Trade-offs & Limitations
Native client history is simpler for single-agent work; Git remains the source of truth for committed changes. Déjà vu fills the gap between them by searching across agents and recovering uncommitted edits when those edits were recorded. It trades the centralized access of a hosted memory service for local control and retrieval that does not depend on remote inference. Coverage is bounded by what each client saves, what its reader supports, and what remains in the source store or local index.

Local storage still needs governance: the index can retain transcripts after their originals are deleted, and pattern-based redaction cannot make every transcript or note safe to share. Use `policy.json` to control which origins can surface in search, MCP, or automatic recall, and review `.deja/memory.jsonl` before committing it. MIT licensing permits commercial use, but does not settle permissions or retention obligations for indexed data.

### Hardware & Deployment Guide
Start with a tagged binary or package-manager install and validate search before changing client settings. `deja install --auto` wires MCP and hooks into detected clients; binary-only search needs neither. The Dockerfile builds `./cmd/deja` with `CGO_ENABLED=0`, installs `sqlite` in the Alpine runtime image, and defaults to `deja mcp` over stdio. A container needs read access to the host transcripts, and persisting its index avoids rebuilding it on each fresh container. Default retrieval needs no GPU, model server, or API key.

Local retrieval does not mean every command is offline: release checks, explicit update and SSH sync, and configured embedding endpoints can use the network. `DEJA_OFFLINE=1` disables the release check; review the other paths separately for isolated deployments. Release v0.25.2 added persistent `config.toml` defaults and Unix-socket MCP. v0.25.3 added pre-execution plan checks against recorded project decisions and kept live rules gating opt-in.
```

## Key Capabilities
```text
- Incremental index: Append-only `records.bin`, token-bucket overlays, and watermarks in `manifest.gob` track transcript changes.
- MCP interface: The default endpoint exposes one `deja` tool with mode-based dispatch; recall responses are capped at 4 KB.
- Edit provenance: `restore`, `blame`, and `origin` use recorded edit spans to recover changes and trace lines or commits back to sessions.
- Context continuity: Pre-compaction hooks capture decisions, files, and verification commands for bounded recall on the next turn.
- Git-backed memory: `.deja/memory.jsonl` stores curated, content-hashed notes with `merge=union`; imported notes are framed as untrusted.
- Data controls: Index-time credential redaction, project and harness exclusions, and `deja forget` serve different retention needs.
```

## Quick Start / Clone
```bash
npx @vshulcz/deja-vu audit --secrets               # scan local logs for expiry & leaked keys, no install
npx @vshulcz/deja-vu install --auto                # install and wire detected agents
curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh && deja install --auto
claude plugin marketplace add vshulcz/deja-vu && claude plugin install deja-vu@deja-vu
codex plugin marketplace add https://github.com/vshulcz/deja-vu && codex plugin add deja-vu@deja-vu
gemini extensions install https://github.com/vshulcz/deja-vu
opencode plugin add opencode-deja
```
