Skip to content

Claude Code Plugins

Memex Plugin: Persistent Research Memory

A Claude Code plugin that preserves collaborative AI-human work across sessions — persistent, searchable, interconnected memos in an Obsidian vault.

Memex Plugin solves a fundamental problem in AI-assisted research: when your session ends, the context disappears. The insights, the decision rationale, the tensions you worked through — gone. Memex preserves it.

Info

Created by: Xule Lin

GitHub: linxule/memex-plugin

Core insight: "The context window is the only thing that makes a given instance of Claude this instance. Memex preserves it."


Host Support

HostStatusNotes
Claude Code (CLI)FullThe plugin's native target — hooks, commands, and the curator skill all run.
Claude Code (Desktop "Code" tab)FullSame engine; identical behavior.
Codex CLI / Codex DesktopAdjacentThe plugin runs inside Claude Code, but a Codex session can install it for you cross-host (claude plugin marketplace add linxule/memex-plugin && claude plugin install memex@memex-plugins --scope user), after which you switch over to Claude Code to use the slash commands and hooks. If you'd rather stay in Codex, the memex Python CLI is portable on its own — uv tool install git+https://github.com/linxule/memex-plugin.git gives you vault read/search/write in any shell, just without the auto-save hooks and slash commands.
Cursor / other clientsOut of scopePlugin format is CC-only.

The vault itself is just an Obsidian folder of markdown files — readable by anything that reads markdown.


Why This Matters for Research

Research projects span weeks or months. Each session with Claude builds understanding — which papers matter, what theoretical tensions you're tracking, why you chose one methodology over another. Without persistent memory, every new session starts from scratch.

Memex captures the collaborative journey:

  • Decisions and rationale — not just what you decided, but why
  • Perspectives and tensions — disagreements and tradeoffs, not just conclusions
  • Evolving understanding — how your thinking developed across sessions

How It Complements Claude's Built-in Memory

Claude Code's native auto-memory stores preferences and conventions — "always use uv", "prefer Sonnet for quick tasks." Think of it as working memory: how you work.

Memex is collaborative long-term memory: what you've worked on together, how you got there, and what's still open.

Auto-memory (built-in)Memex
ScopeSession-scoped preferencesCross-session archive
CapturesConventions, patternsFull transcripts + structured memos
GranularityKey-value pairsPer-compaction-window transcripts
SearchExact matchHybrid FTS + semantic
Answers"What does this user prefer?""Why did we choose this approach 3 weeks ago?"

How It Works

Two-Layer Memo System

The active Claude instance writes memos after substantial collaborative work (~20 messages). These memos carry the weight of having been there — the nuanced understanding that comes from working through a problem together.

Layer 1 memos capture:

  • Key decisions and their context
  • Tensions between competing approaches
  • Insights that emerged through dialogue
  • What was tried and why it worked (or didn't)

Obsidian Vault Integration

Memos organize into an Obsidian vault with:

  • Project folders — memos grouped by research project
  • Wikilinks — connections across sessions and projects
  • Hybrid search — full-text + optional semantic search
  • Knowledge graphs — visualize how your research connects

Commands

CommandWhat it does
/memex:save [title]Save current context as a memo
/memex:statusShow vault statistics
/memex:openOpen vault in Finder/Obsidian

Retrieval and maintenance now live in skills plus the portable CLI, rather than extra slash commands:

SurfaceWhat it does
recall skillUses memex search, memex timeline, and memex ask to retrieve past decisions into the current conversation
garden-tending skillRuns vault health checks, link repair, and crystallization readiness work
memo-writing skillWrites substantial session memos and extracts observations
curator-practice skillPeriodic vault review and topic curation
memex search "<query>"Hybrid FTS + optional vector search
memex timeline yesterdayDate-based browsing
memex ask "<question>"Deep retrieval over memos and extracted observations
memex backfill obsExtract observations from existing memos
memex status / memex checkVault statistics and health checks

Automatic Hooks

The plugin hooks into Claude Code's session lifecycle automatically:

HookWhenWhat
SessionStartNew sessionLoads project context, recent memos, open threads
UserPromptSubmitEach messageTracks activity, nudges to save after ~20 messages
SessionEndSession closesArchives transcript
PreCompactBefore compactionWrites signal file for safety-net memo generation

Research Workflow Example

Week 1: You and Claude analyze 20 papers, develop initial coding framework. Memex captures the framework rationale and which papers were pivotal.

Week 3: You return after a break. Ask Claude to recall the coding framework, or run memex search "coding framework" directly — not just the framework itself, but why you made each decision.

Week 5: You're writing up methodology. The garden-tending / curator-practice skills and memex ask surface how your analytical approach evolved across sessions, giving you the reflexivity narrative for your paper.


Installation

Prerequisites

Required

Optional

  • Obsidian for visual graph navigation
  • GEMINI_API_KEY or LM Studio for semantic search (keyword search works without it)

Quick Start

# 1. Install the CLI package
uv tool install git+https://github.com/linxule/memex-plugin.git

# 2. Inside Claude Code, add the marketplace and install the plugin
/plugin marketplace add linxule/memex-plugin
/plugin install memex@memex-plugins --scope user

# 3. Restart Claude Code to load hooks
claude

For a local clone or unreleased changes:

git clone https://github.com/linxule/memex-plugin.git ~/memex
cd ~/memex
uv tool install .
/plugin marketplace add ~/memex
/plugin install memex@memex-plugins --scope user

Configuration

Create ~/.memex/config.json to customize your vault location:

{
  "memex_path": "/path/to/your/memex/vault",
  "session_context": {
    "verbosity": "standard"
  }
}

See config.json.example in the plugin repo for all available options.

Import Existing Sessions

If you've been using Claude Code already, you have transcripts worth importing. The discover_sessions.py tool scores existing sessions by file edits, commits, and duration to find the ones with real collaborative work:

# See what's available
uv run scripts/discover_sessions.py --triage

# Import and rebuild index
uv run scripts/discover_sessions.py --import --apply
uv run scripts/index_rebuild.py --incremental

Semantic Search (Optional)

Without embeddings, keyword search (FTS5) works out of the box. For semantic search:

# Option A: LM Studio (fully local, recommended)
# Install LM Studio, load an embedding model, start server

# Option B: Gemini API
export GEMINI_API_KEY=your-key

# Build embeddings
uv run scripts/index_rebuild.py --full

Part of the Research Memex Ecosystem

Memex Plugin works alongside: