Engram · guides ← back to site

Claude Code keeps forgetting between sessions. Here's the fix.

On Tuesday your agent fixed the deploy script, learned the staging box runs Caddy behind Cloudflare, and wrote down the exact rsync flags that don't nuke the vault. On Thursday you ask it to touch the deploy script again and it asks which deploy script.

Claude Code — like every agent — starts each session from zero. Context is bounded and priced; everything worth keeping has to live somewhere. The built-in memory files help, but they're flat markdown the model skims at startup: no search, no dedup, no hygiene, and nothing shared with other tools.

The pattern that actually works: an MCP memory server

Engram is a local-first memory daemon for agents. Install it once and Claude Code gets six new tools:

engram_capture

Save a memory explicitly — never automatic.

engram_search

Hybrid FTS + vector search over the vault.

engram_get

Read one memory by ID.

engram_context

Assemble relevant memories into a context block.

engram_health

Vault stats and daemon status.

engram_decay

Hygiene pass: strengthening, decay, duplicate report.

Setup (one minute)

npx -y @elai-intelligence/engram-mcp setup

The helper prompts once, writes a 0600 config, and tells Claude Code to launch the server. From then on every session carries the tools.

How to use it

During the session, say "remember that" and the agent captures it:

remember: the staging box runs Caddy behind Cloudflare; deploy with rsync --no-owner --no-group, never --delete at repo root

Next session, when the topic comes up, engram_context pulls the memories that actually match — instead of the agent re-deriving the facts or asking you again.

Two design choices worth knowing

Explicit capture only

Nothing is saved unless a capture is called. Your vault never fills with auto-ingested noise, and duplicates are skipped and reported, not silently stored.

Local-first

The vault is a SQLite database on your machine, encrypted at rest. The MCP server is a thin client in front of a local daemon — no cloud round-trip, no telemetry.

What it looks like in practice

The honest version: this doesn't replace Claude Code's context — it's a long-term layer underneath it. Session context handles the current task; Engram handles the things that should survive the session boundary. After a few weeks the vault accumulates what you'd otherwise re-explain: server quirks, project decisions, your preferences, where things live.

Memory decays over time (strength fades unless reinforced), so the vault stays relevant instead of becoming a hoard.

The same vault works in Cursor and any MCP client — memories saved in one show up in the others.

Engram by EL AI Intelligence — local-first memory for AI agents. Optional end-to-end encrypted sync across machines and teams. All guides · engram.ellmstack.dev