By sdsrss
Persists coding decisions, bugfixes, and project context across Claude Code sessions using a local SQLite database with hybrid FTS5 + TF-IDF search. Record bugs with reproduction steps, save lessons and workarounds, and search full project history without external services.
Use when: user asks to increase claude-mem-lite's tool-invocation rate in the current project, or to (re)install the steering block. Writes a sentinel-wrapped managed block into <cwd>/CLAUDE.md plus a <cwd>/.claude/plugin_claude_mem_lite.md detail doc, and migrates away any legacy memory-dir sentinel. Runs automatically on SessionStart; use this to force it now. Run /unadopt to remove.
Use when: logging a known bug + repro steps you can't fix right now. Writes to the mem events table (NOT memdir). Skip for bugs you're actively fixing in the current turn — just fix them.
Use when: capturing a non-obvious lesson/gotcha/workaround after a tricky fix or surprising behavior. Writes to the mem events table (NOT memdir). Skip for typos, renames, or user-preference rules.
Use when: querying past work, managing memories, or checking project history
Use when: user asks to remember something, after solving a non-obvious problem, or to capture key session findings
Matches all tools
Hooks run on every tool call, not just specific ones
Admin access level
Server config contains admin-level keywords
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Modifies files
Hook triggers on file write and edit operations
Modifies files
Hook triggers on file write and edit operations
claude-mem-lite is a persistent memory (also called long-term memory or cross-session context) system for Claude Code — Anthropic's CLI coding agent. It runs as an MCP server plus a set of Claude Code hooks, automatically capturing coding observations, decisions, and bug fixes during sessions, then providing hybrid full-text + semantic search to recall them later.
Compared to general-purpose LLM memory frameworks like mem0 or the MCP reference memory server, claude-mem-lite is purpose-built for Claude Code's hook lifecycle: episode batching cuts LLM calls 7–10× vs the original claude-mem (an estimated ~600× lower total cost — see the cost model below; this is an architecture estimate, not a measured benchmark), while the hybrid FTS5 + TF-IDF retriever benchmarks at 0.88 Recall@10 / 0.96 Precision@10.
中文简介:claude-mem-lite 是 Claude Code 的轻量级持久化记忆 / 长期记忆 / 跨会话上下文插件,基于 MCP 协议 + 钩子机制,自动捕获编码会话中的决策、修复和上下文,并通过 FTS5 + TF-IDF 混合检索召回。详见 中文 README。
Zero external services. Single SQLite database. Minimal overhead.
A ground-up redesign of claude-mem, replacing its heavyweight architecture with a smarter, leaner approach.
| claude-mem (original) | claude-mem-lite | |
|---|---|---|
| LLM calls | Every tool use triggers a Sonnet call | Only on episode flush (5-10 ops batched) |
| LLM input | Raw tool_input + tool_output JSON | Pre-processed action summaries |
| Conversation | Multi-turn, accumulates full history | Stateless single-turn extraction |
| Noise filtering | LLM decides via "WHEN TO SKIP" prompt | Deterministic code-level Tier 1 filter |
| Runtime | Long-running worker process (1.8MB .cjs) | On-demand spawn, exits immediately |
| Dependencies | Bun + Python/uv + Chroma vector DB | Node.js only (3 npm packages) |
| Source size | ~2.3MB compiled bundles | ~50KB readable source |
| Data directory | ~/.claude-mem/ | ~/.claude-mem-lite/ (hidden, auto-migrates) |
For a typical 50-tool-call session (illustrative cost model — the ratios below are architecture estimates derived from batch size, token counts, and model pricing, not a measured end-to-end benchmark):
| claude-mem | claude-mem-lite | Ratio (estimated) | |
|---|---|---|---|
| LLM calls | ~50 (every tool use) | ~5-8 (per episode) | ~7-10x fewer |
| Tokens per call | 1,000-5,000 (raw JSON + history) | 200-500 (summaries only) | ~5-10x smaller |
| Total tokens | ~100K-250K | ~1K-4K | ~50-100x less |
| Model cost | Sonnet ($3/$15 per M) | Haiku ($0.25/$1.25 per M) | ~12x cheaper |
| Combined savings | ~600x lower cost (estimated) |
| Dimension | Winner | Why |
|---|---|---|
| Classification accuracy | Tie | Both produce correct type/title/narrative |
| Noise filtering | lite | Code-level filtering is deterministic; LLM "WHEN TO SKIP" is unreliable |
| Observation coherence | lite | Episode batching groups related edits into one coherent observation |
| Code-level detail | original | Sees full diffs, but rarely useful for memory search |
| Search recall | Tie | Users search semantic concepts ("auth bug"), not code lines |
| Hook latency | lite | Async background workers; original blocks 2-5s per hook |
The original sends everything to the LLM and hopes it filters well. claude-mem-lite filters first with code, then sends only what matters to a smaller model. This is not a downgrade; it's a smarter architecture that produces equivalent search quality at a fraction of the cost.
How claude-mem-lite differs from the major neighbors in the LLM-memory space (verified May 2026):
npx claudepluginhub sdsrss/claude-mem-lite --plugin claude-mem-liteAST knowledge graph for intelligent code navigation — auto-indexes your codebase and provides semantic search, call graph traversal, HTTP route tracing, and impact analysis via MCP tools
AI orchestration tool for Claude Code — GSD management shell + Superpowers quality core
OpenLTM — Long-Term Memory for AI coding agents: semantic search, context injection, session learning
Persistent memory for Claude Code. Capture work across sessions and recall relevant context.
Persistent memory system for Claude Code with SQLite, FTS5, and vector search
Persistent memory across Claude Code sessions using Cognis
Memory compression system for Claude Code - persist context across sessions
Multi-tiered memory and knowledge base with semantic search, auto-compaction, and built-in evaluation. Works across Claude Code, Copilot CLI, OpenCode, Cline, and Cursor.