lore
lore is a semantic search MCP server for searching and managing your local Claude Code conversations using hybrid vector + keyword search — all without external API calls.
Search conversations (
search): Perform semantic and keyword searches across indexed Claude Code sessions, with optional filters for project, branch, and date rangeGet surrounding context (
get_context): Expand a search result by retrieving conversation content before, after, or around a given chunkIndex sessions (
index): Trigger background indexing in incremental mode (new/changed only), full mode (complete rebuild), or cancel a running index jobList sessions (
list_sessions): Browse all indexed conversation sessions, filterable by project and sortable by dateManage projects (
manage_projects): List, register, or unregister Claude Code projects for indexing, with clean removal of unregistered project dataCheck status (
status): Monitor indexing progress, session counts, database size, and overall system health
All processing runs fully locally with conversation-aware chunking (preserving tool-use chains and thinking blocks) and supports over 100 languages.
lore
Semantic search across your Claude Code and OpenAI Codex CLI conversations. Find anything you've ever discussed -- across all projects, all sessions, any branch, any agent.
Features
Hybrid search (vector + keyword) Combines multilingual-e5-small embeddings with FTS5/BM25 via Reciprocal Rank Fusion. Finds results by meaning and exact terms.
Multi-agent: Claude Code + Codex CLI Indexes both
~/.claude/projects/(Claude Code) and~/.codex/sessions/(OpenAI Codex CLI) in the same DB. Codex sessions are grouped bycwdfromsession_meta, surfaced ascodex-<path>virtual projects so you can search them together or filter to one agent.Fully local, zero API keys Everything runs on your machine. ONNX Runtime for embedding, sqlite-vec for storage. No data leaves your device.
Auto-index on session end A SessionEnd hook automatically indexes all new sessions in the background. No manual triggers needed.
Background indexing Manual index triggers return instantly. Monitor progress while you keep working. Search what's already indexed while the rest catches up.
Opt-out by default All projects are indexed automatically. Exclude the ones you don't want. No registration needed.
Conversation-aware chunking Splits by logical turns (user question + full assistant response chain), not arbitrary token windows. Handles tool-use chains, thinking blocks, and multi-step interactions correctly.
100+ languages Korean, Japanese, Chinese, English, and 90+ more. CJK-aware token estimation for accurate chunking.
Related MCP server: quarry
Quick Start
Add to Claude Code
# No install needed — always runs latest version
claude mcp add -s user lore -- npx getlore
# Or for a single project only
claude mcp add -s project lore -- npx getloreAdd to OpenAI Codex CLI
# No install needed
codex mcp add lore -- npx getlorenpm install -g getlore
# Then register with your tool:
claude mcp add -s user lore -- getlore # Claude Code
codex mcp add lore -- getlore # Codex CLI
# Manage your install:
getlore --version # Check installed version
getlore update # Update to latestUsage
Once connected, the AI can use lore's tools directly:
You: "What did we discuss about auth refactoring last week?"
Claude: [calls lore search] Found 3 relevant conversations...
In your "my-webapp" project on March 15, you decided to...First time setup:
Index --
index()scans all projects automatically, runs in backgroundSearch -- ask anything about past conversations
Exclude (optional) -- hide noisy projects you don't care about
Tools
Tool | Purpose |
| Exclude/include projects from indexing (opt-out model) |
| Start background indexing. All non-excluded projects. Modes: |
| Check indexing progress, ETA, skip reasons, DB health |
| Semantic + keyword search across conversations |
| Expand search results with surrounding conversation |
| Browse indexed sessions by project |
Why This Exists
Claude Code stores every conversation as a JSONL transcript in ~/.claude/projects/, and OpenAI Codex CLI stores its rollouts in ~/.codex/sessions/YYYY/MM/DD/. After a few weeks, you have hundreds of sessions across dozens of projects, often spread across both agents -- discussions about architecture decisions, debugging sessions, code reviews, and design explorations.
But there's no way to search through them. You can't ask "what approach did we take for the auth middleware?" or "which project had that database migration discussion?"
Existing tools either require cloud APIs, spawn zombie processes, or treat conversations as generic documents. lore is purpose-built for AI coding sessions: it understands turn boundaries, tool-use chains, and thinking blocks, and parses both Claude Code and Codex JSONL formats natively. It runs entirely locally with zero dependencies beyond Node.js.
How It Works
~/.claude/projects/*/*.jsonl ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl
\ /
\ /
JSONL Parser (Claude Code + Codex formats, skips noise)
|
Turn-pair Chunker (groups by logical conversation turns)
|
Transformers.js (multilingual-e5-small, INT8 quantized, 384d)
|
sqlite-vec + FTS5 (hybrid vector + keyword storage)
|
Reciprocal Rank Fusion (combines both signals for ranking)Codex sessions are grouped by cwd extracted from each file's session_meta line and surfaced as codex-<path> virtual projects in the index.
Storage: Single SQLite file at ~/.lore/lore.db with WAL mode for concurrent reads.
Config: Project exclusions stored in ~/.lore/config.json.
Environment Variables
Variable | Default | Description |
|
| Data directory |
|
| Database path |
|
| Claude Code transcripts location |
|
| OpenAI Codex CLI rollouts location |
Measured on Apple Silicon (M-series):
Metric | Value |
Search latency | 20-30ms |
Index speed | ~10 sessions/sec |
First search (cold model load) | ~5s |
DB size | ~0.1MB per 10 sessions |
Model size (downloaded once) | ~112MB |
"No sessions found"
Run manage_projects with action list to see available projects. All are indexed by default unless excluded.
Stale lock file
If indexing was interrupted, the lock file auto-cleans on next run (PID-based detection).
DB corruption
Delete ~/.lore/lore.db and re-index. Your source data (~/.claude/projects/) is never modified.
Development
git clone https://github.com/hyunjae-labs/lore.git
cd lore
npm install
npm run build
npm test # 135 testsTech Stack
Model Context Protocol SDK -- stdio transport
@huggingface/transformers -- multilingual-e5-small (INT8)
better-sqlite3 + sqlite-vec -- embedded vector DB
Reciprocal Rank Fusion -- hybrid search ranking
License
MIT
Available Tools
6 toolsget_contextA
Retrieve more conversation context around a specific search result. Use ONLY after calling search, when you need to see what was discussed before or after a result.
Inputs: chunk_id (required), direction, count.
indexA
Update the search index with recent Claude Code sessions. Call if search returns stale results or the user asks to refresh the index. Modes: 'incremental' (default, only new/changed), 'full' (delete all and rebuild from scratch), 'cancel' (stop running index).
Inputs: mode, project, confirm.
list_sessionsB
List all indexed Claude Code sessions. Use when the user wants to browse conversation history or find sessions by project/date.
Inputs: project, limit, sort.
manage_projectsA
Manage which projects are registered for indexing. Use 'list' to see all projects on disk and their registration status. Use 'add' to register a project for indexing. Use 'remove' to unregister. Projects must be registered before they can be indexed.
Inputs: action (required), project.
searchB
Search through past Claude Code conversations across all projects. Use when the user asks about previous discussions, past decisions, or anything from a prior conversation.
Inputs: query (required), project, branch, after, +2 more.
statusA
Check the health and progress of lore indexing. Shows indexing status, session counts, DB size. Use this to monitor indexing progress after calling index.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap: get_context retrieves conversation context around search results, index updates the search index, list_sessions lists indexed sessions, manage_projects handles project registration, search performs searches, and status checks indexing health. The descriptions explicitly differentiate their use cases, preventing agent confusion.
Tool names follow a consistent snake_case pattern and use clear verbs like get, index, list, manage, search, and status. However, 'status' deviates slightly as a noun rather than a verb (e.g., 'check_status' would be more consistent), but overall the naming is predictable and readable.
With 6 tools, this server is well-scoped for its purpose of managing and searching conversation history. Each tool serves a specific function in the indexing and retrieval workflow, from setup (manage_projects, index) to query (search, get_context) and monitoring (list_sessions, status), with no unnecessary bloat.
The tool set provides complete coverage for the domain of indexing and searching Claude Code sessions. It includes project management (manage_projects), indexing operations (index, status), session listing (list_sessions), search functionality (search), and context retrieval (get_context), ensuring agents can handle the full lifecycle without gaps.
Maintenance
Related MCP Connectors
Persistent memory for Claude Code and Cursor. Stop re-explaining your project every session.
Your versioned prompt library: search, read, save and version prompts from Claude Code.
Search your knowledge bases from any AI assistant using hybrid RAG.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
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.-
- AlicenseAqualityAmaintenanceEnables local semantic search over documents and code for Claude Code and Claude Desktop, running entirely offline with local embeddings and vector storage.147MIT
- AlicenseNot gradedqualityDmaintenanceProvides Claude Code with local semantic search and indexing of your codebase using AST-aware chunking and hybrid search, enabling deep code understanding without sending data to the cloud.MIT
- FlicenseNot gradedqualityBmaintenanceLocal semantic search over Claude Code sessions and shell command history, exposed to Claude Code as an MCP tool. Everything is indexed into one vector space and runs entirely on your machine.2-