DESK · THEORY
The Workflow · May 5, 2026

Persistent memory across Claude Code sessions

Index your notes, decisions, and past work into a local search engine. Pull the relevant pieces into any Claude Code session with one command: /recall.

What you'll have when you're done

A laptop where Claude Code remembers what you already know. You point a tool called QMD at a folder of markdown notes: your Obsidian vault, your meeting summaries, your project docs, last quarter's strategy memos. QMD builds a local search index in under a minute. Then inside any Claude Code session, you type /recall <topic> and Claude pulls the most relevant chunks of your past thinking into the conversation before you write a single sentence.

No re-pasting files. No "as I mentioned last time." No re-explaining the architecture or the strategy or the customer history for the eighth time.

The whole thing runs locally on your laptop. Nothing goes to the cloud. Setup takes 30 minutes the first time and zero minutes thereafter.

Why this matters

You are paying the same context tax every Claude Code session: 5-15 minutes re-orienting the model on a codebase, a memo, a board doc, a pricing model. Across a week, that is two to three hours you spend typing things you have already typed.

The deeper cost is worse. Because re-orienting is annoying, you avoid starting new sessions. You jam everything into one bloated thread until it slows to a crawl, then you give up and lose the thread entirely. Persistent memory removes the friction. Sessions become disposable. The knowledge compounds in one searchable place instead of dying in 400 abandoned tabs.

This is the difference between Claude Code as a clever toy and Claude Code as an operator's tool.

What you need first

You do not need: Homebrew, a paid Mem0 account, a vector database, an OpenAI key, or any cloud service. This is all local.

Step-by-step

You are installing two things and writing one short configuration file:

You install QMD first, point it at your notes folder, build the index, then create the /recall command. Total: 30 minutes.

Step 1Confirm Claude Code is working

Before installing anything new, confirm Claude Code itself runs.

  1. Open Terminal.
  2. Run:
claude --version
  1. You should see a version number print out. If you see "command not found," install or reinstall Claude Code from claude.ai/code and try again.

Step 2Install QMD

QMD installs via Bun, a fast JavaScript runtime. (You do not need to know what Bun is. It is just the installer mechanism here.)

  1. Install Bun. In Terminal:
curl -fsSL https://bun.sh/install | bash

This downloads and installs Bun. The script will print instructions at the end about adding Bun to your PATH (the list of places your shell looks for commands).

  1. Add Bun to your PATH. Add this line to your shell config file. If you use zsh (the default on modern Macs), the file is ~/.zshrc. If you use bash, it is ~/.bashrc.
echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.zshrc
  1. Reload your shell so the change takes effect:
source ~/.zshrc
  1. Install QMD globally:
bun install -g https://github.com/tobi/qmd
  1. Verify QMD installed:
qmd --version

You should see a version number. If you see "command not found," the PATH change in step 2-3 did not stick. Close Terminal completely, reopen it, and try qmd --version again.

Step 3Index your notes folder

QMD works by adding a collection (a folder of markdown files) and then embedding it (building the search index). You only do this once per folder; future updates are incremental.

  1. Move into the folder you want indexed. Replace ~/notes with the actual path to your notes: your Obsidian vault, your meeting-notes folder, wherever your markdown lives.
cd ~/notes
  1. Add the folder as a QMD collection:
qmd collection add . --name workspace --mask "**/*.md"

Translation: "Add the current folder (.) as a collection called workspace. Index every .md file in it, including subfolders."

  1. Build the search index:
qmd embed

This reads every markdown file and builds the local search index. The first run can take a minute or two if you have hundreds of notes; subsequent runs only update changed files.

  1. Test the search. Run a quick query against your collection:
qmd search "any topic you remember writing about"

You should see relevant snippets from your notes returned in seconds. If you do, the search layer works.

Step 4Wire up the /recall slash command

Custom slash commands in Claude Code are reusable prompts you can trigger with /name inside any session. You are going to create one called /recall that runs the QMD search on your current question.

Claude Code supports two formats for custom commands. The simpler legacy format is what we'll use here: a single markdown file.

  1. Create the commands folder (if it does not exist):
mkdir -p ~/.claude/commands

The ~/.claude/ folder is a hidden folder in your home directory. Claude Code reads custom commands from inside it.

  1. Create the recall command file:
nano ~/.claude/commands/recall.md

nano is a simple text editor that runs in Terminal. It opens an empty file.

  1. Paste this content into the editor (the frontmatter at the top is required; everything below the second --- is the prompt body):
---
description: Run QMD semantic search on the current question and feed results back into the session
argument-hint: [query]
---

Run a QMD search for relevant context using the user's current question.

User question: $ARGUMENTS

Search and summarize the most relevant results, then continue helping with the original request, citing which note each fact came from.
  1. Save and exit nano: hit Ctrl+O, then Enter to save, then Ctrl+X to exit.

  2. Open a new Claude Code session (Claude Code auto-detects new commands; no restart needed):

claude
  1. Test the command. Inside the session, type:
/recall pricing assumptions

(Replace pricing assumptions with any topic you know is in your notes.) Claude should run the search, find relevant chunks, and produce a brief summary citing which notes each fact came from. If it does, the full loop is working.

Step 5Use it on a real project

The setup is now in place. To make it stick:

  1. Pick one real project you have used Claude Code on. A pricing model, a draft memo, a config file, anything.
  2. Open a fresh Claude Code session in that project's folder.
  3. Before asking your first real question, type /recall <topic>. For example: /recall pricing assumptions or /recall last quarter's strategy review.
  4. Watch what Claude pulls in. Notice what is useful and what is noise.

After three or four real uses, you will have a feel for how to phrase recalls. The skill is not in the install. The skill is in remembering to start every session with /recall.

How you'll know it's working

Inside any new Claude Code session, /recall <any topic from your notes> should return a brief summary with citations to specific notes within 2-3 seconds. If it does, the full loop works.

You can also verify QMD directly. Run:

qmd search "any topic"

You should see ranked snippets from your indexed notes in well under a second.

When it breaks

Where this fits in your harness

Persistent memory is the foundation layer. Once Claude Code can pull from everything you have already written down, every other workflow on top of it gets cheaper: skills you teach the model stick, decisions you make once stop getting re-litigated, and the cost of starting a new session drops to near zero.

This is the first move in the harness. The next moves (connectors that let Claude read your inbox and CRM, project-specific instructions that travel with a folder, autonomous routines that run on schedule) only pay off once you have memory in place. Build this weekend. Layer the rest in the weeks after.

The Thursday 3

Get three workflows like this every Thursday

The Thursday 3 is a free weekly email. Three workflows that put you in the top 1% of CEOs. 90-second read. Every card links back to a step-by-step guide like this one.

Get the newsletter →
The Complete Guide to OpenCLAW

The architecture behind this workflow.

A 270-page operator's manual for the harness Andrew runs Headphones.com and Lantern.is on. Memory, skills, connectors, and the 90-day roadmap.

Get the book · $99