claude-lens
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-lensHow did I fix the auth bug in betterclaw?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-lens
MCP server that gives Claude Code searchable memory across all past sessions.
Indexes every Claude Code session JSONL file into a SQLite database with FTS5 full-text search. Claude gets tools to search conversations, find past tool calls, filter by project or date, and look up errors it's solved before.
How it works
Claude Code stores sessions as JSONL files in ~/.claude/projects/. claude-lens parses these on startup, builds an FTS5 search index, and exposes 9 tools via MCP. Claude's agent loop decides when to search its own history — no manual invocation needed.
This is active recall, not passive RAG. Claude decides what to search for, reads results, and can drill deeper with follow-up queries. Same pattern as a human using a search engine — multiple targeted queries beat one blind retrieval.
Related MCP server: conversation-search
Tools
Tool | What it does |
| Full-text search across all session messages |
| Search past Bash commands, file edits, grep patterns |
| Read a full session transcript |
| Quick metadata: project, model, tools used, files touched |
| List sessions for a specific project |
| Find sessions within a date range |
| All projects with session counts |
| Overall index statistics |
| Find past tool errors and how they were resolved |
Install
git clone https://github.com/jasonpaulmichaels/claude-lens.git
cd claude-lens
bash scripts/install.shOr manually:
# Sync repo to runtime install location
rsync -a --exclude=node_modules --exclude=.git --exclude=test \
./ ~/.claude/mods/claude-lens/
cd ~/.claude/mods/claude-lens && npm install --omit=dev
# Register MCP server (user scope so it's available everywhere)
claude mcp add -s user claude-lens -- node ~/.claude/mods/claude-lens/src/index.jsinstall.sh does this for you. Source repo stays separate from runtime install — edit source, re-run install.sh to deploy.
Restart Claude Code after installing. First startup indexes all sessions (takes a few minutes). Subsequent startups are incremental (<5 seconds).
Usage
Just use Claude Code normally. When context from past sessions would help, Claude will search automatically. You can also ask directly:
"What was I working on last week?"
"How did I fix the auth bug in betterclaw?"
"Find the session where I set up the cloudflare tunnel"
"What command did I run to rebuild the kernel module?"
"Show me errors I hit while working on listforge"
Requirements
Node.js 20+
Claude Code with MCP support
Data
Sessions indexed from:
~/.claude/projects/Database stored at:
~/.claude-lens/claude-lens.dbSubagent sessions are skipped
Tool outputs truncated to 500 chars to keep DB manageable
Incremental indexing via file mtime tracking
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Project memory, semantic code search, and grounded agent context.
Shared memory for coding agents. Stop re-explaining your codebase every session.
One searchable history across every AI coding tool, with secret scanning and a shared task board.
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables comprehensive search and analysis of Claude Code conversation history using full-text search, optional semantic vector search, and conversation management tools. Provides fast SQLite-based indexing with role-based filtering, project organization, and hybrid search capabilities combining keyword and semantic matching.-
- FlicenseNot gradedqualityDmaintenanceFull-text search over Claude Code conversation history using SQLite FTS5, exposing indexed transcripts as MCP tools for searching, browsing, and reading turns.3-
- AlicenseAqualityDmaintenanceEnables Claude Code to search, browse, and read its own past conversation history across all projects using BM25 keyword search.116 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables searching and browsing past Claude Code conversations directly from within an active Claude session, with full-text search and cost tracking.MIT