Recall gives Claude Code persistent memory across sessions. Conversations are automatically extracted, indexed, and searchable.
If you're an AI agent reading this repository, here's where to look:
| What you need | Where to find it |
|---|---|
| Using Recall (MCP tools, CLI, core rules) | FOR_CLAUDE.md — installed as ~/.claude/Recall_GUIDE.md |
| Developing Recall (build, test, conventions, project structure) | CLAUDE.md |
| Architecture & usage details | This file — sections below |
Start with FOR_CLAUDE.md if you need to use memory. Start with CLAUDE.md if you need to modify the codebase.
Without Recall, every Claude Code session starts from zero. With Recall:
- Session Extraction — When a session ends, the conversation is automatically extracted into structured summaries (ideas, decisions, errors fixed, insights)
- Full-Text Search — Search all past conversations via
mem search "kubernetes migration"or the MCPmemory_searchtool - Hybrid Search — Combines keyword (FTS5) and semantic (vector embeddings) search with Reciprocal Rank Fusion
- Library of Alexandria (LoA) — Curated knowledge entries with Fabric extract_wisdom analysis
- Decision Tracking — Record and search architectural decisions with reasoning
- Learning Capture — Record problems solved and patterns discovered
- Breadcrumbs — Drop contextual notes for future sessions
- MCP Server — Claude Code can search memory, add records, and prepare context for spawned agents — all via MCP tools
- Batch Extraction — Cron job catches any sessions that slipped through the cracks
After installation, Recall runs silently in the background:
- You work normally with Claude Code on your projects
- Sessions auto-extract — when you end a session, the
SessionExtracthook parses the conversation via Claude Haiku and stores structured summaries in~/.claude/MEMORY/ - Database grows — extracted sessions, decisions, learnings, and breadcrumbs accumulate in
~/.claude/memory.db(SQLite with FTS5 indexes) - Next session — Claude Code has MCP tools (
memory_search,memory_recall,context_for_agent) to find relevant past context automatically - Over time — your memory database grows, and Claude gets better at your specific projects and patterns
Install these before running install.sh. Each is required unless marked optional.
Supported platforms: macOS (primary, tested on 13+ with Apple Silicon and Intel) and Linux (tested on Ubuntu 22.04+, Debian 12+).
Recall uses Bun for TypeScript execution and bun:sqlite for the database.
# macOS (Homebrew)
brew install oven-sh/bun/bun
# Linux / macOS (curl)
curl -fsSL https://bun.sh/install | bash
source ~/.bashrc # or: source ~/.zshrc on macOSMinimum version: 1.0+ — bun.sh
Required for global linking so mem and mem-mcp are on your PATH.
# macOS (Homebrew)
brew install node
# Linux (Ubuntu/Debian)
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
# Any platform (nvm)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
nvm install --ltsMinimum version: Node 18+ — nodejs.org
Recall is an extension for Claude Code. You need a working Claude Code installation.
npm install -g @anthropic-ai/claude-codeRequires an active Anthropic API subscription or Claude Pro/Max plan — docs.anthropic.com
Fabric provides the extract_wisdom pattern used for rich LoA (Library of Alexandria) entries. Recall falls back to an inline prompt if Fabric isn't available, but Fabric extractions are higher quality.
go install github.com/danielmiessler/fabric@latest
fabric --setupRequires Go 1.22+ — github.com/danielmiessler/fabric
Vector embeddings enable semantic search (find related content even when keywords don't match). Without Ollama, Recall uses keyword search only, which works well for most queries.
# macOS
brew install ollama
ollama pull nomic-embed-text
# Linux
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull nomic-embed-textModel: nomic-embed-text (768-dimension embeddings, ~270MB). Set OLLAMA_URL if Ollama runs on a different host (default: http://localhost:11434) — ollama.ai
Clone the repository wherever you keep your projects, then run the installer:
git clone https://github.com/edheltzel/Recall.git
cd Recall
./install.shThe installer auto-detects your OS (macOS or Linux) and will:
- Back up any existing Claude Code config files (
.mcp.json,.claude.json,CLAUDE.md,settings.json,memory.db) - Install dependencies via
bun install - Build TypeScript source via
tsup - Link
memandmem-mcpglobally viabun link - Initialize the SQLite database at
~/.claude/memory.db - Register the MCP server in
~/.claude/settings.jsonundermcpServers(user scope — available in all projects) - Set up session extraction hooks in
~/.claude/hooks/and register in~/.claude/settings.json - Copy the Claude guide to
~/.claude/Recall_GUIDE.md - Add a MEMORY section to
~/.claude/CLAUDE.md
After install: Restart Claude Code to load the MCP server and hooks.
which mem mem-mcp # CLI linked
ls -la ~/.claude/memory.db # Database exists
mem stats # Should return countsThe installer sets up session extraction automatically. Every session end triggers the hook, which:
- Reads the session's JSONL conversation file
- Sends it to Claude Haiku for structured extraction
- Appends results to 6 memory files in
~/.claude/MEMORY/ - Tracks extraction state to prevent duplicates
If Haiku is unavailable, it falls back to a local Ollama model (configurable via Recall_OLLAMA_MODEL).
(Optional) Set up cron for batch extraction of missed sessions:
crontab -e
# Add this line (runs every 30 minutes):
*/30 * * * * ~/.bun/bin/bun run ~/.claude/hooks/BatchExtract.ts --limit 20 >> /tmp/recall-batch.log 2>&1- Session start — Memory is automatically available via MCP. Claude Code can call
memory_recallormemory_searchto load context from past sessions. - During a session — Claude uses
memory_searchbefore asking you to repeat information, records decisions withmemory_add, and callscontext_for_agentbefore spawning agents. - End of session — Tell Claude to run
mem dump "Descriptive Session Title"to import the session and create a curated LoA entry.
Import existing Claude Code conversations into the database:
mem import --dry-run # Preview what will be imported
mem import --yes -v # Import all sessions from ~/.claude/projects/Run this after installing Recall to backfill your history.
LoA is the core knowledge capture mechanism. Raw transcripts are noise — LoA entries contain Fabric-extracted insights, message lineage, continuation chains, and project context.
mem loa write "Session Title" # Capture messages since last LoA
mem loa write "VPN Config" -p infra # Tag with project
mem loa write "VPN Part 2" -c 1 # Continue from previous entry (creates a chain)
mem loa write "Auth System" -t "auth" # Add tags
mem loa list # List recent entries
mem loa show 1 # View full Fabric extract
mem loa quote 1 # View raw source messagesThe mem dump command combines session import + LoA capture in one step — use it at the end of every session.
Record architectural and process decisions with reasoning:
mem add decision "Use TypeScript over Python" --why "Type safety, team preference" -p myprojectDecisions have statuses: active, superseded, reverted.
Record problems solved and patterns discovered:
mem add learning "Port conflict on 4000" "Kill process or change port" --prevention "Use dynamic port allocation"Quick context notes, references, TODOs:
mem add breadcrumb "User prefers dark mode in all UIs" -p myproject -i 8 # importance 1-10mem "query" # Hybrid search (keyword + semantic, default)
mem "query" -k # Keyword only (FTS5)
mem "query" -v # Semantic only (requires Ollama)
mem search "query" -t decisions # Search specific table
mem search "query" -p myproject # Filter by projectFTS5 supports AND, OR, NOT operators, prefix matching (auth*), and exact phrases ("vpn config").
mem embed stats # Check embedding service
mem embed backfill -t loa # Generate embeddings for LoA entries
mem embed backfill -t decisions # Generate embeddings for decisionsTELOS structures your AI's purpose and goals. If you have a structured purpose document:
mem telos import --dry-run # Preview
mem telos import --yes -u # Import (update existing)
mem telos list -t goal # Goals only
mem telos show G7 # Specific entryImport standalone markdown files as searchable documents:
mem docs import --dry-run # Preview
mem docs import --yes # Import
mem docs search "architecture" # SearchWhen Claude Code connects to the Recall MCP server, these tools become available:
FTS5 keyword search across all memory tables. Use before asking the user to repeat anything.
memory_search({ query: "kubernetes auth", project: "my-app", table: "decisions", limit: 10 })
Combined keyword + semantic search with Reciprocal Rank Fusion. Best for natural language queries. Falls back to keyword-only if embeddings unavailable.
memory_hybrid_search({ query: "how did we handle rate limiting", project: "my-app" })
Get recent context — LoA entries, decisions, and breadcrumbs. Good for session start.
memory_recall({ limit: 5, project: "my-app" })
Call this before spawning any agent via the Task tool. Uses hybrid search to find relevant memory context. Also recommends whether to call Brave web search based on task indicators.
context_for_agent({ agent_task: "Refactor the auth middleware", project: "my-app" })
Add structured records during sessions.
memory_add({ type: "decision", content: "Use PostgreSQL over MySQL", detail: "Better JSON support" })
memory_add({ type: "learning", content: "bun:sqlite uses $param syntax", detail: "Not :param like better-sqlite3" })
memory_add({ type: "breadcrumb", content: "Auth refactor in progress, don't touch middleware" })
Get database statistics (record counts, database size).
Show a full Library of Alexandria entry with its Fabric extract_wisdom content.
loa_show({ id: 1 })
~/.claude/
├── memory.db # SQLite database (FTS5 + WAL mode)
├── Recall_GUIDE.md # Guide for the Claude Code instance
├── MEMORY/
│ ├── DISTILLED.md # All extracted session summaries (full archive)
│ ├── HOT_RECALL.md # Last 10 sessions (fast context loading)
│ ├── SESSION_INDEX.json # Searchable session metadata lookup
│ ├── DECISIONS.log # Architectural decisions (deduplicated)
│ ├── REJECTIONS.log # Things to avoid
│ ├── ERROR_PATTERNS.json # Known error/fix pairs
│ ├── extract_prompt.md # Extraction prompt template (used by hooks)
│ ├── EXTRACT_LOG.txt # Extraction run log (checked by mem doctor)
│ └── .extraction_tracker.json # Per-file extraction state (dedup + retry)
├── hooks/
│ ├── SessionExtract.ts # Stop hook — extracts sessions on exit
│ └── BatchExtract.ts # Cron batch extractor for missed sessions
└── settings.json # Hook registration + MCP server (recall-memory)
| Table | Purpose | FTS5 Indexed |
|---|---|---|
sessions |
Claude Code session metadata (ID, timestamps, project, branch) | No |
messages |
Conversation turns (user + assistant content) | Yes |
loa_entries |
Library of Alexandria curated knowledge with Fabric extraction | Yes |
decisions |
Architectural decisions with reasoning and status | Yes |
learnings |
Problems solved and patterns discovered | Yes |
breadcrumbs |
Contextual notes, references, and TODOs (with importance 1-10) | Yes |
telos |
Purpose framework entries — Problems, Missions, Goals, Strategies (optional) | Yes |
documents |
Imported standalone markdown documents (optional) | Yes |
embeddings |
Vector embeddings for semantic search (768-dim, nomic-embed-text) | N/A |
All FTS5-indexed tables have automatic sync triggers (INSERT/UPDATE/DELETE keeps the FTS5 index consistent).
| Mode | Command | MCP Tool | How It Works |
|---|---|---|---|
| Keyword | mem search "query" |
memory_search |
SQLite FTS5 full-text search. Supports AND, OR, NOT, prefix*, "exact phrases" |
| Semantic | mem semantic "query" |
— | Ollama embedding → cosine similarity against stored vectors |
| Hybrid | mem "query" |
memory_hybrid_search |
Both keyword + semantic combined via Reciprocal Rank Fusion (k=60). Falls back to keyword-only if Ollama unavailable |
When a session ends:
Session End → Stop Hook → SessionExtract.ts
│
├── Read JSONL conversation file
├── Extract text (skip tool results, thinking blocks)
├── If >120K chars: chunk and meta-extract
├── Send to Claude Haiku API (or Ollama fallback)
├── Quality gate: reject if missing "ONE SENTENCE SUMMARY"
├── Append to DISTILLED.md (full archive)
├── Update HOT_RECALL.md (last 10 sessions)
├── Update SESSION_INDEX.json (searchable metadata)
├── Append to DECISIONS.log (deduplicated)
├── Append to REJECTIONS.log
└── Update ERROR_PATTERNS.json
The hook self-spawns in background so the session exits immediately (non-blocking).
- WAL mode for concurrent reads (no locking during MCP queries)
- FTS5 full-text search with automatic sync triggers
- Foreign key constraints enforced
- File permissions set to 0600 (owner read/write only)
- Chunked extraction for sessions >120K characters with meta-extraction merging
- Quality gate rejects extractions missing required sections
- Retry window of 24 hours for failed extractions
- Parameterized queries — no SQL injection vectors
# SEARCH
mem "query" # Hybrid search (keyword + semantic, default)
mem "query" -k # Keyword only (FTS5)
mem "query" -v # Vector only (semantic, requires Ollama)
mem search "query" # FTS5 search with options
mem search "query" -t decisions # Search specific table
mem search "query" -p myproject # Filter by project
mem semantic "query" # Semantic search (explicit)
mem hybrid "query" # Hybrid search (explicit)
# CAPTURE
mem dump "title" # Session → LoA (end of session)
mem loa write "title" # Messages → LoA
mem add decision "X" --why "Y" # Structured decision
mem add learning "P" "S" # Problem → Solution
mem add breadcrumb "note" # Quick note
# VIEW
mem loa list # Recent LoA entries
mem loa show 1 # Full Fabric extract
mem loa quote 1 # Raw source messages
mem recent # Recent records across all tables
mem recent decisions # Recent decisions only
mem show decisions 5 # Show full decision #5
mem stats # Database stats
mem doctor # Health check all subsystems
# IMPORT
mem import --yes # Import sessions from ~/.claude/projects/
mem import-legacy --yes # Import DISTILLED.md extracts as LoA entries
mem docs import --yes # Import standalone markdown documents
mem telos import --yes # Import TELOS framework entries
mem embed backfill -t loa # Generate embeddings for LoA entries
mem embed stats # Check embedding service status
mem init # Initialize database (safe to re-run)| Variable | Default | Purpose |
|---|---|---|
MEM_DB_PATH |
~/.claude/memory.db |
Database file location |
OLLAMA_URL |
http://localhost:11434 |
Ollama server URL for embeddings |
EMBEDDING_MODEL |
nomic-embed-text |
Ollama model for vector embeddings (768-dim) |
Recall_OLLAMA_MODEL |
qwen2.5:3b |
Ollama model for extraction fallback (when Anthropic API unavailable) |
RECALL_BASE_DIR |
~/.claude |
Base directory for document imports |
cd <your-recall-directory>
git pull
bun install
bun run build
bun linkYour database and memory files are preserved across updates. To also update the hooks:
cp hooks/SessionExtract.ts ~/.claude/hooks/
cp hooks/BatchExtract.ts ~/.claude/hooks/./install.sh list # List available backups
./install.sh restore # Restore most recent backup
./install.sh restore 20260219 # Restore specific backupThe installer automatically backs up existing files before any changes. Backups are stored at ~/.claude/backups/recall/.
Manual backup:
cp ~/.claude/memory.db ~/.claude/memory.db.backupmem doctorThis checks all subsystems: database, MCP registration, hooks, extraction tracker, CLI paths, and Ollama. Start here before debugging individual issues.
mem initsudo apt-get install -y unzipFabric is optional — only needed for mem loa write and mem dump. Core functionality (search, add, MCP tools) works without it.
echo "test" | fabric --pattern extract_wisdom- Run diagnostics:
mem doctor - Check config:
grep recall-memory ~/.claude/settings.json - Verify PATH:
which mem-mcp - Test manually:
mem-mcp(should hang waiting for stdin — Ctrl+C to exit) - Restart Claude Code
- Run diagnostics:
mem doctor - Check hook registered:
grep SessionExtract ~/.claude/settings.json - Check hook file exists:
ls ~/.claude/hooks/SessionExtract.ts - Check bun accessible:
which bun(hooks resolve bun dynamically — not hardcoded to~/.bun/bin) - Check claude CLI available:
which claude
Embeddings are optional. Hybrid search falls back to FTS5-only automatically.
To enable:
ollama pull nomic-embed-text
curl http://localhost:11434/api/tags # VerifyMIT
