The argument in one line.
Every coding agent session starts cold because there is nowhere to store what was learned — ClaudeMem closes that gap with a local observation database and a three-layer retrieval design that costs a tenth of loading full history.
Read if. Skip if.
- A developer who uses OpenCode, Claude Code, or any terminal agent daily and finds themselves re-explaining the same project context at the start of every session.
- Someone whose context window budget is getting eaten by re-hydrating old decisions rather than doing actual work.
- Anyone running multi-week projects with a coding agent where continuity across sessions matters more than any single run.
- You use one-off, throwaway coding sessions and never return to the same codebase with an agent.
- You are already satisfied with manually managed CLAUDE.md or system-prompt context injection and do not want an automated background service.
The full version, fast.
Coding agents reset every session, turning context re-entry into pure token overhead. ClaudeMem plugs into OpenCode via lifecycle hooks, records what the agent does (files opened, edits, commands, API calls), compresses observations with AI into a local SQLite database, and uses a vector search index for semantic retrieval. A three-layer search workflow — cheap index first, timeline context second, full detail only when needed — is claimed to use one-tenth the tokens of loading full records. Install is a single command. All data stays local by default, with a private tag to exclude secrets from capture.
Chat with this breakdown — free.
Sign in and you get 23 free chat messages on us — ask for the hook, quote a framework, find the exact transcript moment, generate a markdown action plan. Bring your own key when you want unlimited.
Create a free account →Where the time goes.

01 · The cold-start problem
Names the pain: agents forget everything between sessions, turning context re-entry into token waste. Branded slide sequence S01-S04.

02 · OpenCode and the strange boost
Introduces OpenCode as a provider-agnostic terminal agent. Notes the January 2026 Anthropic third-party block accelerated adoption by making provider agnosticism look like insurance.

03 · What ClaudeMem does
Silently watches agent activity (files, edits, commands, API calls), compresses to summaries, stores locally, injects relevant pieces at next session start.

04 · Local database and vector search
Architecture: SQLite for storage plus a vector search index for semantic retrieval — plain-language queries surface memories even when phrased differently than originally recorded.

05 · The 3-layer retrieval design
Cheap index first (~50-100 tokens), timeline context second, full detail last and only for specific items. Claimed 10x token savings vs. loading full records.

06 · Lifecycle hooks
How capture is automated: hooks fire at session start, prompt sent, tool run, session end. No manual input required.

07 · One-line install on OpenCode
npx claude-mem install --ide opencode. Installer handles Bun and uv if missing. Requires Node 20+ and OpenCode pre-installed.

08 · Web viewer and first-session reality
Worker runs at localhost:37701. Dashboard shows no items on fresh install by design. Memory builds as sessions accumulate.

09 · What actually changes
Session two onwards: agent stops re-pitching ruled-out options, remembers bug patterns, matches code style. Cold vs. warm prompt comparison illustrates the gap.

10 · Interface, privacy, and edge features
MCP tools expose search to the agent. Private tags exclude secrets from capture. Data stays local. Beta: endless mode + OpenClaw gateway for Slack/Discord/Telegram.

11 · The honest part and the bigger picture
Caveats: wrong assumptions get persisted; pause during throwaway sessions; prune stale memories. Closing argument: persistent memory is the line between a one-off helper and a weeks-long build partner.
Lines worth screenshotting.
- Every token spent re-explaining project context to a fresh agent session is pure overhead that burns budget before real work begins.
- OpenCode grew after Anthropic blocked third-party tools from Claude consumer subscriptions in January 2026 — provider-agnosticism became insurance, not a nice-to-have.
- A vector search index on top of SQLite means you can describe a past decision in completely different words and still surface the right memory.
- The three-layer retrieval pattern — cheap index, timeline context, full detail — applies each filter only to items that passed the previous one, not to everything at once.
- The first session after install feels identical to before because the memory is still empty; the value compounds from session two onward.
- A wrong agent assumption that gets compressed and saved can carry forward as a persistent false belief — the database inherits the agent's mistakes, not just its insights.
- Local-only storage is the privacy default: no project history leaves the machine, and private tags exclude secrets from capture entirely.
- Memory that compounds across weeks is what separates an agent that is handy for a one-off task from one that genuinely keeps pace with a production codebase.
- Running the same prompt cold vs. memory-warm reveals the difference immediately: generic defaults vs. context-aware output that matches your patterns on the first try.
- Bun and uv are both auto-installed if missing — the single-command install is genuinely one command with no manual dependency setup.
Why every agent session starting cold is a compounding tax.
Re-explaining project context to a fresh agent session is not just friction — it is a measurable token cost that compounds across every day of development on the same codebase.
- Every session that starts cold forces the agent to guess at decisions you already made — the corrections you give it are tokens spent going backwards, not forwards.
- A three-layer retrieval pattern — cheap index first, timeline context second, full detail only for specific items — keeps memory injection from cannibalizing the context window you need for actual work.
- Vector search on past session observations means you can describe a prior decision in plain language and surface the right memory even if the phrasing is completely different from how it was originally captured.
- The quality of persistent memory is bounded by the quality of what the agent did during sessions — a wrong assumption that gets compressed and saved becomes a persistent false belief that requires deliberate correction.
- Local-only storage removes the cloud dependency that would make a background memory service a single point of failure for production workflows, and it is the privacy default, not an opt-in.
- The compound effect of memory only becomes visible after the second session — expecting immediate results from a fresh install is the wrong mental model for evaluating whether the tool works.
- Pausing memory capture during throwaway or experimental branches is not optional hygiene — it prevents the permanent library from accumulating dead-end context that will mislead future sessions.
Terms worth knowing.
- ClaudeMem (claude-mem)
- An open-source background service that captures coding agent session activity, compresses it into a local database, and injects relevant context into future sessions. Supports OpenCode, Claude Code, Gemini CLI, and others.
- OpenCode
- An open-source terminal-based AI coding agent that is provider-agnostic, able to run Anthropic, OpenAI, Google, or local Ollama models interchangeably.
- Lifecycle hooks
- Trigger points built into an agent framework that fire at defined moments such as session start, prompt sent, tool run, and session end. Used by ClaudeMem to capture observations automatically without user action.
- Vector search index
- A database layer that stores text as mathematical embeddings so that semantically similar phrases match even when the exact words differ, enabling plain-language queries against past session memory.
- 3-layer retrieval
- ClaudeMem's search strategy: a cheap index of IDs and tiny summaries, then timeline context around interesting results, then full detail fetched only for specific items. Applied in sequence to minimize token cost.
- Endless mode
- A beta ClaudeMem feature designed to keep memory coherent across very long stretches of continuous work, beyond normal session boundaries.
- OpenClaw gateway
- An integration that runs ClaudeMem as a persistent memory layer on a gateway server, with the ability to stream live observations to external services like Discord, Slack, or Telegram.
- Bun
- A JavaScript runtime used by ClaudeMem to run the background worker process that captures and compresses session observations.
- uv
- A Python package manager and runtime used by ClaudeMem to power the vector search component. Auto-installed during setup if not already present.
Things they pointed at.
Lines you could clip.
“Every word of re-explaining is burning tokens just to get back to the starting line you were already at.”
“Persistent memory is quietly becoming the line between an agent that's handy for a one-off task and one you can actually build with over weeks.”
“Treat it like a tool you steer, not one you set loose and forget.”
Word for word.
Don't just watch it. Burn it in.
See every word as it's spoken — crank it to 2× and still catch all of it. The same dual-channel trick behind Amazon's Kindle + Audible.
The bait, then the rug-pull.
The quiet frustration nobody warns you about when you start using AI agents in the terminal: the agent that finally understood your naming style and the weird workaround you needed for that one service wakes up the next session as a total stranger. Every word of re-explaining burns tokens just to reach the starting line you were already at.
Named ideas worth stealing.
The 3-Layer Memory Retrieval Workflow
- search — compact index, IDs + tiny summaries (~50-100 tokens)
- timeline — chronological context around interesting observations (low cost)
- get_observations — full detail only for filtered IDs (~500-1,000 tokens)
ClaudeMem's token-efficient memory lookup applies three sequential filters before fetching expensive full-detail records, claiming ~10x savings vs. naive full-record loading.
How they asked for the click.
“If you did, please like this video and subscribe to the channel, and I'll see you in the next video.”
Minimal single-sentence close after the main content. No product pitch, no newsletter, no sponsor.





































































