thedotmack/claude-mem

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

What it solves

Claude-Mem provides persistent memory for Claude Code, allowing the AI to maintain continuity of knowledge across different sessions. It prevents the loss of project context when sessions end or reconnect, ensuring that observations and tool usage from previous interactions are preserved and available for future use.

How it works

The system uses a combination of lifecycle hooks (such as SessionStart and PostToolUse) to automatically capture observations and generate semantic summaries. These are stored in a SQLite database and a Chroma vector database for hybrid semantic and keyword search. A local worker service managed by Bun provides an HTTP API and a web viewer UI. To retrieve information, it employs a "progressive disclosure" strategy via MCP tools, where Claude first searches for a compact index of results, then views a timeline, and finally fetches full details only for specific IDs to save tokens.

Who it’s for

Developers using Claude Code, OpenCode, or Antigravity CLI who want their AI agent to remember project history, bug fixes, and technical decisions across sessions.

Highlights

  • Persistent Memory: Context survives across sessions automatically.
  • Progressive Disclosure: A 3-layer search workflow (search $\rightarrow$ timeline $\rightarrow$ get_observations) that reduces token costs by up to 10x.
  • Hybrid Search: Combines full-text SQLite search with Chroma vector database for intelligent retrieval.
  • Privacy Control: Supports <private> tags to exclude sensitive content from storage.
  • Web Viewer UI: Provides a real-time stream of memories in a browser.
  • MCP Integration: Provides 4 MCP tools for natural language querying of project history.