# zhutov-qmd-grep-dead-claude-code-memory-recall-2026-03-01

## Veille

QMD local search engine for Obsidian vault, skill /recall for persistent memory in Claude Code, BM25 + semantic + hybrid search vs grep

## Titre Article

Grep Is Dead: How I Made Claude Code Actually Remember Things

## Date

2026-03-01

## URL

https://github.com/tobi/qmd

## Keywords

QMD, local search engine, persistent memory, BM25, semantic search, hybrid search, Obsidian, Claude Code, skill recall, vault indexing, context engineering, grep, embeddings, knowledge base, sessions, context reconstruction, Tobias Lütke, Shopify

## Authors

Artem Zhutov (article/vidéo démonstration), Tobias Lütke (créateur QMD)

## Ton

**Profile**: Practitioner-demonstrator perspective, accessible and enthusiastic register, intermediate to advanced level

**Description**: Artem Zhutov adopts the tone of a passionate early adopter sharing his discoveries in real time. The style is that of narrated live coding — spontaneous exclamations ("That's so amazing!", "This is the one that surprised me"), before/after comparisons (grep 3 minutes vs QMD instant), and concrete metrics (700 sessions, 39 sessions in a single day). The author moves between technical tutorial (CLI commands, architecture) and personal narrative (PhD, happiness patterns, forgotten ideas). Demonstrating semantic search on his own personal notes (sleep, frustration, unrealized ideas) makes the argument visceral and credible. The target audience consists of heavy Claude Code and Obsidian users who feel the "cold start" problem at every session.

## Pense-betes

- **Core problem**: every conversation with Claude Code starts from scratch. 700 sessions in 3 weeks, inability to retrieve context, loss of decisions during compaction at 60% context. Claude Code's native grep (via a Haiku sub-agent) takes 3 minutes, returns 300 files of noise, and consumes a lot of tokens.
- **QMD**: local search engine created by Tobias Lütke (CEO of Shopify). Indexes markdown files into collections. 11,482 GitHub stars. MIT license. Three search modes:
- **BM25** (`qmd search`): deterministic full-text search. Like grep but with TF-IDF scoring — a short file mentioning "sleep" 5 times scores higher than a 10,000-word file with a single mention. No AI, no embeddings, just math. Results in 2 seconds.
- **Semantic** (`qmd vsearch`): uses embeddings to find meaning even without exact keywords. "insomnia" returns nothing in BM25 but "couldn't sleep, bad night" retrieves notes on bedtime discipline. 4 out of 5 results don't contain the searched words.
- **Hybrid** (`qmd query`): combines BM25 + semantic + query expansion + LLM re-ranking. Best ranking but ~30 seconds. Uses Reciprocal Rank Fusion.
- **Local models**: everything runs on the machine, no external API. Three GGUF models: Gemma 300M embedding, Qwen3 0.6B reranker, 1.7B query expansion. ~2 GB total.
- **Agent integration**: built-in MCP server, Claude Code marketplace plugin (`claude marketplace add tobi/qmd`), JSON/CSV/MD/XML output optimized for LLMs.
- **Skill /recall**: a Claude Code skill built on top of QMD. Three modes:
- **Temporal** (`/recall yesterday`): reconstructs the session timeline by date. 39 sessions in a single day with time, message count, summary.
- **Topic** (`/recall topic graph`): cross-collection BM25 search, retrieves all files related to a subject in under a minute.
- **Graph** (`/recall graph last week`): interactive HTML visualization — sessions as colored blobs, files grouped by type, traceable connections.
- **Session pipeline**: when the terminal closes, a hook automatically exports and indexes the Claude Code session into QMD. Parses plain markdown (user messages), filters out tool uses and system prompts. The index is always fresh.
- **grep vs QMD benchmark**: search for "sleep" → grep returns 200 files including `sleep()` (system command), BM25 returns relevant reflections on sleep quality, semantic retrieves related notes without the keywords, hybrid produces the best ranking.
- **Surprising insight**: search for "find the ideas I have never acted on" → Claude adapts the query into multiple semantic searches and retrieves ideas forgotten for months (PhD dashboard, Obsidian screen recording). Search "days when I was happy" → pattern: happiest days = shipping + good recovery (sauna, 9 hours of sleep).
- **Practical recommendation**: start with BM25 (80% of searches, fast, structured). Add semantic search for transcripts and braindumps (free-form text, no precise keywords).
- **Philosophy**: "Tools change. Your context stays." — tools evolve (Claude Code, Codex, Gemini CLI) but personal context persists. Notes stop being passive — they become actionable.
- **Strong connection to prior coverage**: directly addresses the "cold start" problem identified by Debois ("every session is a new employee") and Vasilopoulos (3-tier architecture). QMD is a concrete implementation of Tier 3 (Cold Memory) with the skill /recall as the loading mechanism. The automatic session pipeline implements Debois's Context Flywheel.

## RésuméDe400mots

Artem Zhutov presents a solution to a fundamental problem in AI agent-assisted development: **loss of context between sessions**. With 700 Claude Code sessions in 3 weeks, he observes that every conversation starts from scratch, that compaction at 60% context loses decisions, and that native grep (via a Haiku sub-agent) takes 3 minutes to return 300 files of noise.

The solution relies on **QMD**, a local search engine created by Tobias Lütke (CEO of Shopify), which indexes markdown files into queryable collections. QMD offers three search modes. **BM25** performs full-text search with relevance scoring — unlike grep, which returns every string match (including `sleep()` for a search on sleep), BM25 weights by term frequency and rarity, delivering relevant results in 2 seconds. **Semantic search** uses local embeddings to find meaning beyond keywords: a search for "couldn't sleep, bad night" retrieves a note on bedtime discipline even though no term matches. **Hybrid search** combines both with query expansion and LLM re-ranking for the best possible ranking.

Everything runs locally through three GGUF models (~2 GB): Gemma 300M embeddings, a Qwen3 0.6B reranker, and a 1.7B query-expansion model. QMD integrates with agents via an MCP server or a Claude Code plugin.

On top of QMD, Zhutov built the **skill /recall**, a Claude Code skill that automatically loads relevant context before each session. Three access modes: **temporal** (reconstructing the session timeline by date), **topic** (cross-collection BM25 search on a subject), and **graph** (interactive HTML visualization of sessions and files). A terminal-close hook automatically exports and indexes each session into QMD, keeping the index always fresh.

The demonstrations reveal unexpected uses. A semantic search for "find the ideas I have never acted on" surfaces projects forgotten for months. "Days when I was happy" brings out a pattern: the best days correlate shipping with physical recovery. Semantic search turns a passive vault into **active memory** capable of surfacing connections invisible to keywords.

The underlying philosophy resonates with context engineering: tools change, context stays. A well-indexed vault survives model and tool changes. Zhutov concretely demonstrates what Debois theorizes with the Context Flywheel: document the context → better output → enrich the context → accelerate.

## GrapheDeConnaissance

- Tobias Lütke —a_créé→ QMD (TECHNOLOGIE, 0.98)
- Artem Zhutov —a_créé→ skill /recall (TECHNOLOGIE, 0.97)
- QMD —utilise→ BM25 (CONCEPT, 0.98)
- QMD —utilise→ recherche sémantique par embeddings (CONCEPT, 0.98)
- QMD —utilise→ Reciprocal Rank Fusion (CONCEPT, 0.95)
- QMD —remplace→ grep pour recherche vault (TECHNOLOGIE, 0.92)
- QMD —utilise→ Model Context Protocol (TECHNOLOGIE, 0.97)
- skill /recall —est_basé_sur→ QMD (TECHNOLOGIE, 0.98)
- skill /recall —améliore→ reconstruction contexte Claude Code (CONCEPT, 0.95)
- Artem Zhutov —affirme_que→ grep ne passe pas à l'échelle pour agents IA (AFFIRMATION, 0.93)
- recherche sémantique —permet→ transformation du vault passif en mémoire active (CONCEPT, 0.9)
- Tobias Lütke —dirige→ Shopify (ORGANISATION, 0.99)
- QMD —fait_partie_de→ architecture mémoire agents IA (CONCEPT, 0.88)

---
Canonical: https://www.thekb.eu/en/fiches/zhutov-qmd-grep-dead-claude-code-memory-recall-2026-03-01/
