Claude Engram
Persistent memory and session intelligence for AI coding assistants. Hooks into Claude Code's lifecycle to auto-track mistakes, decisions, and context — then mines your full session history to surface patterns, predict what you'll need, and search across everything you've ever discussed.
Zero manual effort. Works with any MCP-compatible client.
What It Does
Automatic (hooks — zero invocation):
- Tracks every edit, error, test result, and session event
- Auto-captures decisions from your prompts ("let's use X", "switch to Y")
- Injects the 3 most relevant memories before every file edit
- Orients before file reads: code-index summary (what the module is, who imports it) + that file's past mistakes, once per file per session
- Warns when you're about to repeat a past mistake
- Error deja-vu: when a failure matches a known recurring error, the past fix is injected inline at failure time ("you hit this in 3 sessions — fix was X")
- Surfaces the project's known-good test commands at session start (tracked from runs that actually passed)
- Opt-in lessons bridge: dated entries in your curated notes files sync as protected memories that resurface when you edit related code (set
lessons_globsin~/.claude_engram/config.json, e.g.["docs/lessons/*.md"]— no default path) - TDD-aware error capture: failing test runs are tracked as test results, not logged as mistakes — deliberate RED-phase failures stop polluting the mistake store
- Detects edit loops (same file 3+ times without progress) — tracked in per-session hook state, so two concurrent sessions never cross-contaminate
- Survives context compaction — checkpoints before, re-injects after
- Mines your session history in the background after every session — and live during it: debounced ticks at turn end keep search, extractions, and code indexes fresh mid-session
- Verifies imports in proposed edits against a per-project code index (AST, no LLM) —
<engram-precheck>with closest-name suggestions - Shows blast radius before editing a shared module — lists its importers (
<engram-blast-radius>) - Measures injection precision — tracks which injected context precedes passing tests (view via
session_mine(reflect)) — and feeds it back: a bounded per-kind multiplier (0.8-1.2) tunes how eagerly memories inject






