# Claude Code With UNLIMITED Memory! Solves Claude's Memory Problem!

## Video Metadata
- **Channel**: WorldofAI
- **URL**: https://www.youtube.com/watch?v=qhuS__jC4n8
- **Upload Date**: 2026-02-05
- **Duration**: ~10 minutes 23 seconds
- **Topic**: Claude-Mem plugin for persistent memory across Claude Code sessions
- **GitHub**: https://github.com/thedotmack/claude-mem
- **Docs**: https://docs.claude-mem.ai/introduction
- **Author**: Alex Newman (@thedotmack)

---

## Executive Summary

WorldofAI demonstrates **Claude-Mem**, an open-source Claude Code plugin that gives Claude persistent memory across sessions. The plugin automatically captures everything Claude does (tool usage, decisions, observations), compresses it with AI, stores it in a local database with vector search, and injects relevant context back into future sessions. The video shows a head-to-head comparison of Claude Code with and without persistent memory, demonstrating significantly improved output quality when memory is enabled.

---

## Key Claims / Metrics

| Metric | Claim |
|--------|-------|
| Token savings | Up to **95% fewer tokens per session** (by not re-explaining context) |
| Tool calls | **20x more tool calls** before hitting limits (budget freed from context reconstruction) |
| Memory injection | Automatic -- captures observations, compresses, and injects relevant context at session start |
| Search capability | Natural language search across all past work via `mem-search` and MCP tools |
| Cost | Free, open-source (AGPL-3.0 license) |
| Storage | Local SQLite + Chroma vector DB |

---

## Technical Architecture (Claude-Mem v6.5.0)

### Component Stack
1. **5 Lifecycle Hooks** (+ Smart Install pre-hook):
   - `SessionStart` -- Initialize memory context, retrieve summaries from last 10 sessions
   - `UserPromptSubmit` -- Inject relevant historical context before Claude processes input
   - `PostToolUse` -- Capture observation data after every tool execution
   - `Stop` -- Generate memory summaries at session pause/checkpoint
   - `SessionEnd` -- Finalize observations, compress memory

2. **Worker Service**: HTTP API on port 37777 with web viewer UI, managed by Bun runtime

3. **SQLite Database**: Stores sessions, observations, summaries with FTS5 full-text search

4. **Chroma Vector Database**: Hybrid semantic + keyword search for intelligent retrieval (uses `all-MiniLM-L6-v2` embedding model)

5. **mem-search Skill**: Natural language queries with progressive disclosure pattern

### 3-Layer Token-Efficient Retrieval

```
Layer 1: search()           -> Compact index with IDs (~50-100 tokens/result)
Layer 2: timeline()         -> Chronological context around results
Layer 3: get_observations() -> Full details for filtered IDs (~500-1K tokens/result)
```

This progressive disclosure achieves ~10x token reduction by filtering before fetching details.

### MCP Search Tools (5 tools)

| Tool | Purpose | Token Cost |
|------|---------|------------|
| `search(query, type, limit, filters)` | Discover relevant observations | ~50-100/result |
| `timeline(observation_id, context_window)` | Chronological context around specific result | Varies |
| `get_observations(ids=[])` | Fetch full observation details by ID batch | ~500-1K/observation |
| `save_memory(text, title, metadata)` | Manual memory storage for semantic search | N/A |
| `__IMPORTANT` | Documentation tool explaining 3-layer pattern | N/A |

### Memory Compression Strategy
- **Automatic**: Captures tool name, input parameters, output, execution time, success status
- **Compression**: Semantic summarization reduces raw observation size by ~70%
- **Progressive Disclosure**: Context injected in layers based on relevance (summary -> headers -> timeline -> full details)

### Configuration
```json
{
  "aiModel": "claude-3-5-sonnet",
  "workerPort": 37777,
  "dataDirectory": "~/.claude-mem",
  "contextInjectionSettings": {
    "autoInject": true,
    "maxTokens": 8000,
    "minRelevanceScore": 0.6
  },
  "vectorSearch": {
    "enabled": true,
    "provider": "chroma",
    "embeddingModel": "all-MiniLM-L6-v2"
  }
}
```

### Prerequisites
- Node.js 18+
- Bun runtime (auto-installed)
- uv (Python package manager, auto-installed)
- SQLite 3 (bundled)
- Claude Code (latest with plugin support)

### Installation
```bash
# Inside Claude Code:
/plugin marketplace add thedotmack/claude-mem
/plugin install claude-mem
# Restart Claude Code
```

### OpenClaw Integration
```bash
curl -fsSL https://install.cmem.ai/openclaw.sh | bash
```
Supports Telegram/Discord/Slack notification feeds.

---

## Video Demo Highlights

### With vs Without Memory Comparison
- **Without Claude-Mem**: Claude produced a functional dashboard but missed project-specific details, had errors, repeated generic patterns, required more iterations to match intended design quality
- **With Claude-Mem**: Remembered previous decisions, tool usage, and context from prior sessions. Produced a cleaner, more precise dashboard that followed design constraints. Included signature features intended from the prompt

### Landing Page Generation
- The presenter injected catalogs of previous landing pages into memory
- Claude remembered design preferences from past sessions without re-explanation
- Generated beautiful, non-generic landing pages in a single shot
- Avoided the "typical purple pull AI SaaS landing page" generic output

### Key Commands Demonstrated
- `/plugin` command to browse and install from marketplace
- Memory injection for design catalogs and UI element typography
- Plan execution using sub-agents with memory context
- Implementation plan with documentation discovery

---

## Genesis Relevance Assessment

### HIGH RELEVANCE -- Comparison to Genesis Memory Architecture

| Aspect | Claude-Mem | Genesis (Current) |
|--------|------------|-------------------|
| **Approach** | Plugin with local SQLite + Chroma | MEMORY.md + Supermemory + Elestio (PG/Qdrant/Redis) |
| **Storage** | Local SQLite + Chroma vector DB | Distributed: PostgreSQL + Qdrant + Redis + Supermemory + FalkorDB |
| **Context injection** | Automatic via hooks (SessionStart, UserPromptSubmit) | Manual via CLAUDE.md + MEMORY.md preloading |
| **Observation capture** | Automatic PostToolUse hook | Partial via observability_logger.py (6-hook system) |
| **Memory compression** | AI-powered semantic summarization (70% compression) | Pre-compaction CTM flush (manual trigger) |
| **Search** | Natural language via MCP + vector search | Supermemory search + Qdrant semantic search |
| **Cross-agent** | Single agent only (local) | Multi-agent via shared Bloodstream MCP |
| **Scalability** | Single machine | Distributed Elestio infrastructure |

### Key Insights for Genesis

1. **Hook-Based Auto-Capture is Superior**: Claude-Mem's PostToolUse hook automatically captures every tool execution. Genesis has the hook infrastructure (observability_logger.py with 6 events) but does NOT auto-capture observations for memory. This is a gap.

2. **Progressive Disclosure Pattern is Brilliant**: The 3-layer retrieval (search -> timeline -> get_observations) minimizes token usage. Genesis could adopt this pattern for Bloodstream MCP queries instead of dumping full context.

3. **UserPromptSubmit Hook for Memory Injection**: Claude-Mem injects relevant context BEFORE Claude processes each prompt. Genesis lacks this -- context comes from CLAUDE.md/MEMORY.md preloading only, not per-prompt injection.

4. **Compression Before Storage**: 70% compression via semantic summarization means less storage, faster search, lower token costs. Genesis stores raw observations without compression.

5. **The "95% Token Savings" Claim**: If accurate, this validates Genesis's Bloodstream Memory vision -- agents drawing exactly what they need from shared memory is vastly more efficient than stuffing CLAUDE.md context.

6. **SQLite Limitation**: Claude-Mem uses SQLite (which Genesis forbids under Rule 7). Genesis's distributed Elestio stack is architecturally superior for multi-agent, but Claude-Mem's simplicity of "just install and forget" is a UX win.

7. **MCP Integration Pattern**: Claude-Mem exposes memory via 5 MCP tools. This validates Genesis's approach of memory-as-MCP-service (Bloodstream). The specific tool design (search, timeline, get_observations, save_memory) is worth studying.

### Actionable Items for Genesis

- **P1**: Add automatic observation capture to Genesis's PostToolUse hook (currently only logs, does not store to memory systems)
- **P1**: Implement progressive disclosure in Bloodstream MCP (3-layer retrieval: search -> context -> full)
- **P2**: Add UserPromptSubmit hook for per-prompt memory injection (currently only SessionStart context loading)
- **P2**: Implement semantic compression before memory storage (reduce raw observation size by 60-70%)
- **P3**: Study Claude-Mem's "Endless Mode" (biomimetic memory architecture for extended sessions) -- may inform Genesis's session crash prevention
- **P3**: Consider Claude-Mem as a lightweight complement for solo Claude Code sessions (while Genesis Bloodstream handles multi-agent)

### What NOT to Adopt
- SQLite storage (Genesis Rule 7 forbids it)
- Local-only architecture (Genesis is distributed by design)
- Single-agent focus (Genesis is multi-agent native)

---

## Sponsor Mentioned
- **PostHog** -- Product analytics, session replay, feature flags, A/B testing. Free tier. Links in video description.

---

## Related Genesis Knowledge Graph Entries
- `KNOWLEDGE_GRAPH/entities/titan_memory.jsonl` -- Titan Memory system (surprise-based learning)
- `KNOWLEDGE_GRAPH/creator_mind/revenue/synthesis_candidates.jsonl` -- "solves AI amnesia with persistent memory" idea (idea_0017)
- `KNOWLEDGE_GRAPH/axioms/alpha_evolve_cycle_21-23.jsonl` -- References to persistent memory patterns

---

## Full Transcript

One of the biggest limitations of Anthropic's Claude models today is the lack of true persistent memory across sessions. And this is due to sessions being stateless by design, as well as them having a small context window in comparison to other models like Gemini. When a chat or coding session ends, the model usually starts fresh the next time. This is where Claude forgets your project context, decisions, and past work. That means you're forced to actually re-explain everything again and again, which not only wastes time, but also burns through your tokens on repeating context instead of actual useful generations. This constant re-priming eats up into your token budget, leaving fewer tokens for real reasoning, tool use, and high-quality output. In practice, that can even limit how effectively Claude can use tools or produce deeper, more thoughtful results because so much of the budget is actually spent just getting the model back up to speed.

But there's a solution to this and it's called Claude Mem. Claude Mem turns Claude Code into a tool that actually remembers your project history across sessions. So you don't have to re-explain context every single time. Instead of forgetting everything when a session ends, Claude Memory or Claude Mem automatically captures what Claude does with tool usage, decisions, and observations, then compresses that information and stores it into a local database with vector search. It can inject relevant context back into future sessions so Claude truly remembers your project. On top of that, it lets you search your past work using natural language through mem-search and MCP tools. And the best part is that it's open source and runs automatically in the background once you install it.

Now to test the impact of persistent memory, I use the same detailed dashboard prompt twice -- once with Claude in a stateless session and once with Claude Mem enabled -- and there's definitely a drastic impact in terms of the differentiation. Without Claude Mem, Claude was able to produce this functional dashboard but it missed a lot of project-specific details. There's a couple of errors already showcasing when I am scrolling through this dashboard -- repeated generic patterns and required more iterations to actually align with the editorial, the high-end product design that was described in this prompt wasn't actually outputted with this generation. Whereas if I am to compare it with the Claude Mem generation, it remembered previous decisions, the tool usage as well as the context from prior sessions which resulted in a cleaner, more precise dashboard that followed the design constraints. And you can see that there's subtle interactions with each component, the signature feature exactly that was intended from the prompt that was actually sent in.

Now I'm not saying that it is perfect because you can see that this generation over here with the chart doesn't look as great. But in terms of adding all of the required features that I had asked for was added with this generation with Claude Mem. The difference clearly shows how persistent memory directly improves output quality, which reduces redundancy as well as allows the model to focus its token budget on creating thoughtful production-ready UI rather than just reconstructing context.

[Sponsor segment: PostHog -- product analytics, session replay, surveys, feature flags, AB testing, free tier, SDK install]

Now, there's a couple of prerequisites that you're going to need to have beforehand. You're obviously going to need to make sure you have Claude Code installed beforehand. If you do not have it, you can easily install it for whatever operating system you have. Then, just make sure you have Node.js 18 or above, Bun installed, uv, and then SQLite 3 for persistent storage.

And once you have all these requirements fulfilled, we can then get started with the installation. It's super simple. All you got to do is go into your terminal and just start up Claude Code using the claude command. Once you have it running, use the /plugin command. And then what you want to do is head over to the marketplace by using the arrow key on your keyboard and you're going to go ahead and add a new marketplace. And that is by clicking enter. This is where you're going to need to go back into the repo or this doc. Essentially, what you want to do is just copy this last section of the creator as well as the repository name. And then what you want to do is just simply go ahead and paste this in into the add marketplace section and click enter. This will clone the repo. Then you'll see within the marketplace section, the new Claude Mem marketplace, and you want to click on enter. You want to browse the plugin and then you want to go ahead and install Claude Mem if you haven't already.

After installing, it's recommended that you close Claude Code and then you can restart it back up and you should have Claude Mem now working within your Claude sessions where you're going to be able to have persistent memory across all of your sessions. Now, this is going to be a huge feature that will help you in so many ways. You can see right now that Bun is actually running which is also going to let you view this with the web viewer UI which is where it's going to prompt open this UI for you to actually manage your session as well as have it so that you can interact with your memory.

Now, there's a lot of different commands that you can use with Claude Mem, like injecting your own memory directly within all of your sessions, which is something that you need to be really careful about, because if you inject the incorrect memory, it could be interfering with future generations and sessions, which is why it's recommended that if you're working with the production build, might want to consider that you should turn off Claude Mem in certain cases.

But now that Claude Mem is enabled, you have a full cycle where you can now use this memory feature, that persistent memory where it's going to be able to read all of your files, write them. It can edit, use bash, glob, grep, all other Claude tools, and it is going to capture all of that with this persistent memory locally. And you're going to be able to even retrieve context with the slash commands to even have it so that you can pull and even inject new memory.

And right now you can see that there's two new commands that you will see Claude Mem do which is where you can execute a plan using sub-agents for implementation which is a pretty cool new feature and then creating an implementation plan with the documentation discovery. So two of these features can go hand in hand. So you can see right here that I had requested to create a landing page and it is going to use the plan tool with the mem feature and you can see that it is using multiple tools to help me execute this task right away.

Also an FYI, if you use MCP tools, you're going to be able to get better memory search with your project history. And you can easily enable this with the link in the description below which showcases how you can set this up.

But you can see that it has created multiple phases as to how it is actually going to create this. So let's go ahead and have it work upon creating this landing page for us. And here we go. Now I want to give you guys some context as to why I created a landing page. What does that actually do with persistent memory? Well, the thing is that I actually went ahead and injected a lot of my previous catalogs of landing pages and I had it reference all of those landing pages because I was going to have it remember my context that I had with previous generations. So I didn't have to re-explain what sort of output I was looking for because clearly if you are to request any AI model to generate a landing page, it is going to generate that typical purple AI SaaS landing page that you don't want to see.

In this case, it saves up 95% of the tokens each time that you start a session. There's far more tool calls to get the best generations outputted. And with memory preserved, you can have it so that Claude can make 20 times more tool calls with Claude Mem enabled, which is why I get these beautiful generations out of it.

And I kid you not, this is another landing page that I had generated with the same prompt. And in this case, it was able to use the catalog of typography UI elements that I had saved through other generations that I had injected into Claude. And you can see that it did do a great job with this interactive landing page that was created in a single shot.

If you like this video and would love to support the channel, you can consider donating to my channel through the Super Thanks option below. Or you can consider joining our private Discord where you can access multiple subscriptions to different AI tools for free on a monthly basis, plus daily AI news and exclusive content, plus a lot more.

But that's basically guys for today's video on Claude Mem as to how you can have persistent memory across all of your sessions within Claude Code. This is a remarkable project and there's a lot more to this. You're only going to get to understand the true capability of it as you use it more and more as you build up your persistent memory and have it used across all of your sessions. I'll leave all these links in the description below so that you can easily get started. But if you haven't already, make sure you go ahead and subscribe to our second channel. Join the newsletter, join the Discord, follow me on Twitter, and lastly, make sure you guys subscribe, turn on notification bell, like this video, and please take a look at our previous videos so that you can stay up to date with the latest AI news. But with that thought, guys, have an amazing day, spread positivity, and I'll see you guys really shortly.

---

*Extracted: 2026-02-16 | Genesis CTM Pipeline*
*Video ID: qhuS__jC4n8*
