DEV Community

Cover image for The Amnesiac That Learned to Remember — Building a Brain for Claude Code
Ruslan Manov
Ruslan Manov

Posted on

The Amnesiac That Learned to Remember — Building a Brain for Claude Code

**

What happens when you give an AI coding assistant persistent memory across sessions, machines, and projects? sqlite-memory-mcp turns Claude Code from a brilliant amnesiac into something that remembers
**


It was 2:47 AM when Claude said something it shouldn't have known.

"The bridge sync conflict you hit last Tuesday — the one where two sessions overwrote the same entity — I fixed the root cause in db_utils.py. Want me to show you the diff?"

I hadn't mentioned that bug. Not in this session. Not in this conversation. The last time I'd touched that code was six days ago, in a different terminal, on a different machine.

Claude remembered.

Not because it has long-term memory by default. It doesn't. Every Claude Code session starts blank — a brilliant amnesiac. Ask it about yesterday's work and it gives you a polite, empty stare.

Unless you give it a brain.

--

sqlite-memory-mcp started because I broke something.

Three Claude Code sessions running in parallel. All writing to the same JSONL memory file. The file corrupted silently — half-written JSON lines, truncated observations, entities that existed in one session and vanished in another.

JSONL doesn't do concurrent writes. It doesn't do transactions. It doesn't do recovery. It's a format designed for append-only logs, pressed into service as a database by developers who needed something simple.

I needed something real.

v0.1.0 was twelve MCP tools and a SQLite database with WAL mode. Write-ahead logging meant multiple sessions could read and write simultaneously without corruption. FTS5 gave full-text search with BM25 ranking. The foundation was boring on purpose — SQLite has been running in production on every smartphone on Earth for two decades. It doesn't break.

That was supposed to be it. A fix. Ship it, move on.

It wasn't.

--

The first thing that happened was sessions.

Claude doesn't know it's Claude. It doesn't know this is session #47 on project "trading-bot" and that session #46 ended with a failing test in portfolio_manager.py. Every session is a fresh start, a new mind, a newborn with a PhD.

Session recall changed that. sqlite-memory-mcp now tracks which session created which entities, what tools were used, what the conversation context looked like. When Claude starts a new session, it can query: "What was I working on last time in this project?"

The answer comes back in milliseconds. Full context. The amnesiac remembers.

--

Then came tasks.

Not tasks for humans — tasks for Claude. A structured task system where one session can leave work for the next. "The FTS5 injection fix is half-done. The sanitization function works but the tests aren't written yet. Priority: high."

Next session picks it up. No human has to re-explain. No context is lost. The AI hands off to its future self like a relay runner passing a baton — except the runner dissolves after every lap and a new one materializes at the starting line.

Task tray UI in PyQt6 sits on your desktop. Kanban board renders as HTML. You can see what Claude is thinking about, what it left unfinished, what it flagged as blocked.

--

Bridge sync was the inflection point.

Two machines. Home desktop running Fedora, laptop on the train. Same memory, synchronized through a git repository. Entity changes push to the bridge, pull on the other side. Lamport clocks for causal ordering. Machine IDs for conflict detection.

Claude on the laptop continues where Claude on the desktop stopped. Same memory. Same task queue. Same knowledge graph. Different hardware, different continent, same mind.

The developer on the train opens Claude Code and says: "What did I do this morning?"

Claude answers. Accurately. With file paths, function names, and the exact commit hash where the work stopped.

--

At v3.4.0, the numbers look like this:

54 MCP tools across 7 focused servers. SQLite WAL for concurrency. FTS5 BM25 search with optional semantic fusion through sqlite-vec. Session tracking, structured tasks, bridge sync, collaboration workflows, entity linking, intelligence layer, causal event ledger with Lamport clocks.

One local SQLite file. No cloud service. No API key. No monthly bill. No data leaving your machine unless you explicitly push to the bridge.

The design constraint never changed: local-first, private by default.

--

3 AM. Claude finishes the refactor I asked for. It creates a task for tomorrow: "Run the full test suite after the schema migration. Check bridge compatibility."

I close the terminal. The session dies. Claude's mind evaporates.

But the memory persists. In a WAL-mode SQLite database on my local disk. Indexed. Searchable. Synchronized. Waiting for the next session to wake up, query the graph, and pick up exactly where the last one left off.

The amnesiac doesn't forget anymore.

Repo: github.com/RMANOV/sqlite-memory-mcp

Top comments (0)