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
| Host | Status | Notes |
|---|---|---|
| Claude Code (CLI) | Full | The plugin's native target — hooks, commands, and the curator skill all run. |
| Claude Code (Desktop "Code" tab) | Full | Same engine; identical behavior. |
| Codex CLI / Codex Desktop | Adjacent | The 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 clients | Out of scope | Plugin 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 | |
|---|---|---|
| Scope | Session-scoped preferences | Cross-session archive |
| Captures | Conventions, patterns | Full transcripts + structured memos |
| Granularity | Key-value pairs | Per-compaction-window transcripts |
| Search | Exact match | Hybrid 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
| Command | What it does |
|---|---|
/memex:save [title] | Save current context as a memo |
/memex:status | Show vault statistics |
/memex:open | Open vault in Finder/Obsidian |
Retrieval and maintenance now live in skills plus the portable CLI, rather than extra slash commands:
| Surface | What it does |
|---|---|
recall skill | Uses memex search, memex timeline, and memex ask to retrieve past decisions into the current conversation |
garden-tending skill | Runs vault health checks, link repair, and crystallization readiness work |
memo-writing skill | Writes substantial session memos and extracts observations |
curator-practice skill | Periodic vault review and topic curation |
memex search "<query>" | Hybrid FTS + optional vector search |
memex timeline yesterday | Date-based browsing |
memex ask "<question>" | Deep retrieval over memos and extracted observations |
memex backfill obs | Extract observations from existing memos |
memex status / memex check | Vault statistics and health checks |
Automatic Hooks
The plugin hooks into Claude Code's session lifecycle automatically:
| Hook | When | What |
|---|---|---|
SessionStart | New session | Loads project context, recent memos, open threads |
UserPromptSubmit | Each message | Tracks activity, nudges to save after ~20 messages |
SessionEnd | Session closes | Archives transcript |
PreCompact | Before compaction | Writes 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
- Claude Code CLI
- Python 3.11+ with uv
Optional
- Obsidian for visual graph navigation
GEMINI_API_KEYor 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
claudeFor 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 userConfiguration
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 --incrementalSemantic 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 --fullPart of the Research Memex Ecosystem
Memex Plugin works alongside:
- Interpretive Orchestration Plugin — Persistent memory across stages of qualitative analysis
- Carrel — The environment Memex lives inside; Carrel sets the desk, Memex remembers what happened on it
- Obsidian Setup Guide — Your knowledge management hub where memos live
- Claude Code Setup Guide — The research environment where Memex operates