Skip to content

Regis-RCR/cmem

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

72 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 cmem

Your Claude Code Conversations, Remembered Forever

Don't just explore your code or foldersβ€”explore your conversations, or pick up where you left off.

Semantic search β€’ Organize by project β€’ Favorite conversations β€’ 100% local

License: MIT Node.js


Get Started

npx @colbymchenry/cmem

Interactive installer configures Claude Code automatically


Ever closed your terminal and lost that perfect Claude conversation? The one where you finally figured out that tricky bug, or designed that elegant architecture?

cmem gives Claude Code a long-term memory. Every conversation is automatically saved, indexed, and searchableβ€”so you (and Claude) can pick up right where you left off.

MCP Integration

Using CMEM MCP to fetch conversational data about previous chat sessions

Claude can search through your conversation history and synthesize answersβ€”all without cluttering your main session context.

Query All Conversational History


Session Navigation

Easily navigate between previous chat sessions and pick back up right where you left off

Browse, search, filter, rename, and restore any conversation with the interactive TUI.

Filter by Folder : Rename : Resume Sessions

Open all previous chat sessions in current directory

Open all sessions in current directory

Why cmem?

🧠 Sub-Agent Summarization β€” When Claude needs context from past sessions, cmem spawns a separate Claude instance to read and synthesizeβ€”keeping your main conversation context clean. Just like Explore agents, but for your conversation history.

πŸ” Semantic Search β€” Find conversations by meaning, not keywords. "That React hooks discussion" or "the database migration plan" just works.

πŸ€– Claude Can Remember β€” Via MCP integration, Claude can search your past conversations. "What did we decide about auth last week?" Finally, context that persists.

πŸ”„ Automatic Sync β€” A background daemon watches your Claude Code sessions and keeps everything indexed in real-time.

πŸ’Ύ Never Lost β€” Every conversation is automatically backed up. Even if Claude Code clears its storage, cmem restores your sessions instantly when you resume them.

πŸ“¦ 100% Local & Private β€” Everything runs on your machine. No cloud services, no API keys, no external servers. Just SQLite + local AI embeddings.

Quick Start

npx @colbymchenry/cmem

The setup wizard will:

  1. Install cmem globally
  2. Download the embedding model (~130MB, one-time)
  3. Optionally set up auto-sync on login (macOS)
  4. Configure MCP server in ~/.claude.json + permissions in ~/.claude/settings.json

That's it. Your conversations are now being remembered.

Requirements

  • Node.js 18+

No other dependencies. The AI embedding model downloads automatically on first use and runs entirely in Node.js.

Usage

cmem                    # Browse sessions in beautiful TUI
cmem --local            # Browse sessions from current folder only
cmem search "query"     # Semantic search across all conversations
cmem watch              # Start the sync daemon
cmem stats              # See what's stored

How It Works

Claude Code sessions β†’ cmem watch daemon β†’ SQLite + Vector DB
                                                ↓
                              Claude Code ← MCP Server ← Semantic Search
  1. Watch: The daemon monitors ~/.claude/ for new/changed sessions
  2. Index: Conversations are parsed and embedded locally using nomic-embed-text-v1.5
  3. Search: Query by meaning using vector similarity
  4. Remember: Claude can access past conversations via MCP tools

Background Daemon

The cmem watch daemon runs in the background and automatically syncs your Claude Code sessions:

  • With daemon installed: Sessions sync automatically whenever you use Claude Code
  • Without daemon: Run cmem watch manually, or sessions sync when you open the TUI

On macOS, you can install the daemon to start automatically on login:

cmem install    # Enable auto-start
cmem uninstall  # Disable auto-start

MCP Tools

Once configured, Claude Code gains these abilities:

Tool What it does
search_and_summarize The star feature β€” Ask a question, get an AI-synthesized answer from past sessions
search_sessions Find sessions by semantic similarity
list_sessions Browse recent sessions
get_session Retrieve full conversation history
get_session_context Get context to continue a past conversation

How search_and_summarize Works

Main Claude Session                          cmem MCP Server
       β”‚                                            β”‚
       β”‚  "What did we decide about auth?"          β”‚
       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ίβ”‚
       β”‚                                            β”‚
       β”‚                                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                                   β”‚ 1. Vector search β”‚
       β”‚                                   β”‚ 2. Find sessions β”‚
       β”‚                                   β”‚ 3. Read content  β”‚
       β”‚                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                                            β”‚
       β”‚                                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                                   β”‚ Spawn Claude CLI β”‚
       β”‚                                   β”‚ (sub-agent)      β”‚
       β”‚                                   β”‚                  β”‚
       β”‚                                   β”‚ Reads sessions,  β”‚
       β”‚                                   β”‚ synthesizes      β”‚
       β”‚                                   β”‚ answer           β”‚
       β”‚                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                                            β”‚
       β”‚  "Based on your Jan 15 session, you       β”‚
       β”‚   decided to use JWT with refresh..."      β”‚
       │◄────────────────────────────────────────────
       β”‚                                            β”‚

This keeps your main context cleanβ€”only the concise summary comes back, not the raw session content. Uses Haiku by default for speed, configurable to Sonnet or Opus.

Commands

Command Description
cmem Launch interactive TUI
cmem --local Launch TUI filtered to current folder
cmem setup Run setup wizard
cmem search <query> Semantic search
cmem list List all sessions
cmem restore <id> Output session context
cmem watch Start sync daemon
cmem install Auto-start daemon on login (macOS)
cmem uninstall Remove auto-start
cmem stats Storage statistics
cmem mcp Start MCP server

TUI Views

Global Tab

All your sessions in one place, smart-sorted into three tiers:

  1. Starred sessions β€” Your favorites, sorted by message count
  2. Named sessions β€” Custom-named conversations, sorted by message count
  3. Everything else β€” Sorted by message count

Press s to star/unstar a session.

Projects Tab

Browse sessions organized by project folder.

  • Press Enter to drill into a project's sessions
  • Press s to enter sort mode β€” use ↑/↓ to reorder, Enter to confirm
  • Custom project order is persisted

TUI Keyboard Shortcuts

Key Action
←/β†’ or h/l Switch tabs (Global / Projects)
↑/↓ or j/k Navigate
Enter Resume session / Open project
s Star session (Global) / Sort mode (Projects)
r Rename session
R Clear custom name
d Delete session
/ Search (Global tab)
Esc Back / Cancel
q Quit

Data Storage

All data is stored locally in ~/.cmem/:

  • sessions.db β€” SQLite database with vector embeddings
  • models/ β€” Downloaded embedding model (~130MB)
  • backups/ β€” Full copies of all conversation JSONLs (auto-restored if Claude deletes them)

Claude Code sessions are read from ~/.claude/.

Tech Stack

  • SQLite + sqlite-vec β€” Embedded vector database
  • transformers.js + nomic-embed-text-v1.5 β€” Local AI embeddings (768 dimensions, runs in Node.js)
  • ink β€” Beautiful terminal UI (React for CLI)
  • MCP β€” Model Context Protocol for Claude integration

License

MIT


Stop losing your best conversations.
npx @colbymchenry/cmem

About

Memory for Claude Code, allow Claude to query multiple conversations or pick up right where you left off 4 weeks ago.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 99.3%
  • JavaScript 0.7%