This book describes a layer-by-layer system for persistent context - CLAUDE.md, session files, auto-memory, hooks, and a local semantic store that survives every session boundary. Claude forgets everything the moment a session ends. The next session opens clean - no project history, no hard-won decisions, no memory of what you explained three times last week. For a solo user on a small task, that is a minor inconvenience. For someone running multiple projects across weeks of active development, it is compounding friction ...
Read More
This book describes a layer-by-layer system for persistent context - CLAUDE.md, session files, auto-memory, hooks, and a local semantic store that survives every session boundary. Claude forgets everything the moment a session ends. The next session opens clean - no project history, no hard-won decisions, no memory of what you explained three times last week. For a solo user on a small task, that is a minor inconvenience. For someone running multiple projects across weeks of active development, it is compounding friction that eats the first third of every session just re-establishing ground. This book builds a memory stack that ends that problem. The stack has four layers, and each chapter deploys one. Stop after any chapter and you have something working. Finish the book and you have a coordinated system where Claude arrives at every session already knowing what matters. Layer one is CLAUDE.md - the file Claude reads before anything else. Most developers have one; most of them are wrong. This book covers what belongs there versus what degrades retrieval the moment it gets too long, and walks through a real audit that cuts a bloated CLAUDE.md in half without losing a single useful rule. Layer two is session files paired with an auto-memory index. Session files capture what is live right now - current task, open blockers, decisions since last session. Auto-memory (the MEMORY.md typed index system) captures what Claude must never have to re-learn: stable preferences, hard-won feedback, architectural decisions that are permanent. The chapter covers the noise filter for what earns a memory entry and the pruning discipline that keeps the index from becoming a context tax. Layer three is the SESSION_LOADER and hooks. A SESSION_LOADER.md assembles context automatically at startup - static project identity on one side, dynamic session state on the other. Wired to a startup hook in settings.json, it fires before you type a single character. Claude opens knowing the project, the current task, and the last session's forward pointer. No setup questions. Layer four is the mempalace - a local semantic memory system built on chromadb, available at https: //github.com/carajadecatalano-hash/mempalace. It stores memories as searchable embeddings organized into isolated project nodes called palaces. When the session file gets too long and the memory index gets too wide, the mempalace handles the overflow with retrieval by meaning rather than filename. It runs entirely on your own hardware. No API key, no monthly bill, no data leaving the machine. Later chapters cover the diary system (structured session logs that feed directly into SESSION_LOADER), Stewards (registered agents that run maintenance tasks on a schedule so the human is not the only thing preventing entropy), and federation (cross-palace search and inbox-based communication when multiple active projects need to share knowledge without sharing storage). Every pattern in this book comes from a real working system. The mempalace architecture described here is the author's own, built and maintained across a multi-palace federation of active projects. Nothing has been rounded off to sound tidier than it is. This book is for advanced Claude Code users who have an established daily loop and want Claude to arrive at every session already loaded - not because it got smarter, but because you built the system that remembers for it.
Read Less