The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Claude Engram listing page.
Persistent memory and session intelligence for Claude Code. Hooks into the session lifecycle to auto-track mistakes, decisions, and context — then mines your full session history so past work resurfaces exactly when it's relevant.
Zero manual effort. Works with any MCP-compatible client.
Everything below is automatic (hooks) unless marked as a tool:
memory, session_mine, work, context checkpoints, deps_map, impact_analyze, scout_search — all annotated read-only/idempotent where true. /engram loads the full reference.From the author — mostly it just works in the background. The few things worth doing on purpose:
/engram when you want Claude to actively reach for the tools (background tracking happens either way).session_mine(commitments)) — a quick, best-effort reorient from the live transcript.The less you poke at it, the better it works. Work in progress — issues welcome.
Retrieval (recall@k): LongMemEval 0.966 R@5 / 0.982 R@10 (500 questions), ConvoMem 0.960 (250 items), LoCoMo 0.649 R@10 (~2k questions); ~43ms/query, 112ms cross-session over 7,310 chunks.
Product behavior: integration suites green — decision capture (97.8% precision), error auto-capture (100% recall), compaction survival (6/6), multi-project isolation (11/11), edit-loop detection (12/12), session mining (64/64), Obsidian-vault compat (25/25).
Full tables and reproduction commands: library-book.
| Platform | What Works | Auto-Capture |
|---|---|---|
| Claude Code (CLI, desktop, VS Code, JetBrains) | Everything | Full — hooks + session mining |
| Cursor / Windsurf / Continue.dev / Zed / any MCP client | MCP tools | No hooks |
| Obsidian vaults | Full (with CLAUDE.md at root) | Full with Claude Code |
Or copy .mcp.json to your project root. That's the only per-project file — hooks and the /engram skill are global. (The CLAUDE.md in this repo documents engram for people working on engram; your projects don't need it.)
Hooks pick up code changes immediately (editable install); reconnect the MCP server (/mcp) to reload it. Data migrations run automatically and are forward-only, idempotent, and downgrade-safe.
Install normally. On first session, engram detects your existing Claude Code history and mines it in the background — decisions, mistakes, and patterns from every past conversation.
All optional. Deep detail on each lives in the library-book.
| Variable | Default | Description |
|---|---|---|
CLAUDE_ENGRAM_MODEL | gemma3:12b | Ollama model — only scout_search, memory(consolidate), session_mine(reflect) use it |
CLAUDE_ENGRAM_EMBED_MODEL | BAAI/bge-base-en-v1.5 | Embedding model (~1.1GB scorer RAM). all-MiniLM-L6-v2 for a ~90MB setup at lower accuracy |
CLAUDE_ENGRAM_EMBED_DIM | model native | Matryoshka truncation dim. Stores are signature-stamped — model changes rebuild them automatically |
CLAUDE_ENGRAM_DEVICE | smart | Unset: daemon stays on cpu, bulk jobs use a transient GPU worker (full VRAM release). cuda/cpu forces one device |
CLAUDE_ENGRAM_GPU_BULK_MIN | 512 | Job size (texts) that routes to the GPU worker |
CLAUDE_ENGRAM_GPU_BATCH | 64 | Rows per forward pass on the GPU. Raise it on a card with headroom; the peak scales linearly (~26 MiB/row) |
CLAUDE_ENGRAM_LIVE_MINE | 300 | Live mining tick interval (seconds); 0 disables |
CLAUDE_ENGRAM_ARCHIVE_DAYS | 14 | Days until inactive memories archive |
CLAUDE_ENGRAM_SCORER_TIMEOUT | 1800 | Scorer daemon idle timeout (seconds) |
CLAUDE_ENGRAM_DIR | ~/.claude_engram | Storage location (also the test-isolation seam) |
CLAUDE_ENGRAM_SESSION_RETENTION_DAYS | 0 (keep all) | Prune session-search shards older than N days |
CLAUDE_ENGRAM_LAST_FILE_PATH | unset | Mirror last-read file path to this file (statusline integration) |
CLAUDE_ENGRAM_HOOK_DEBUG | unset | 1 prints a stderr breadcrumb per hook |
~/.claude_engram/config.json additionally accepts embed_model, embed_dim, and lessons_globs (opt-in lessons bridge: globs of curated markdown whose dated entries sync as protected memories).
If search quality degrades or after a big update:
Or via MCP: session_mine(operation="reindex", mode="bootstrap")
Library Book — design, internals, full usage guide, API reference, gotchas, changelog.
/engram — quick tool reference (installed by install.py).
MIT