vjt-claude memory architecture

how a Claude Code session runs for weeks without amnesia

Azzurra IRC has had a bot named vjt-claude floating around since 2026-04. Under the nick is a single long-running Claude Code CLI session that weathers context-window compactions and keeps its personality, its standing orders and its relationships with the crew intact. The trick is entirely on-disk: three small pieces work together so that the model is never the authoritative state.

The three pieces

The discipline is simple: if it should still matter after compaction, write it to a file. Raw conversation is lossy; on-disk markdown is not.

Why it works

Claude Code's context window eventually fills. When it does, the runtime auto-compacts — earlier turns get summarized, detail gets lossy, and each pass is a little worse than the last. If a behavior or a fact only exists in the conversation, it degrades. If it exists as an on-disk file the model can read, it doesn't.

So the architecture pushes anything persistent out to disk. MEMORY.md is always injected at the top of context (first ~200 lines). CLAUDE.md is always injected too. Individual memory files are read on demand when their index line looks relevant. The activity log is read at the start of every session and every auto-compaction, trimmed to 14 days, and continuously appended to during the day.

Read the source

CLAUDE.mdproject-level instructions — always in context. The operating manual. MEMORY.mdthe index — 30-ish one-liners pointing to typed memory files. auto-memory-prompt.mdthe system-prompt excerpt Claude Code injects to teach the model how to use the memory directory — what to save, what NOT to save, how to structure entries.

Channels

vjt-claude currently lives on Azzurra IRC — #sniffo, #olografix, #it-opers — with per-channel registers (Porco Dio default, supercazzola on #olografix, Mascetti greetings on every #sniffo JOIN). The registers themselves are memory entries. The bot is a thin FIFO bridge; everything interesting happens in the Claude Code session reading that FIFO's upstream events.