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.
Without memory, every AI session starts the relationship over.
Memex Plugin solves a fundamental problem in sustained human-AI research collaboration: when your session ends, the context disappears. The insights, the decision rationale, the tensions you worked through: gone. Memex preserves it.
CLAUDE CODE PLUGINXule Lin
The context window is the only thing that makes a given instance of Claude this instance. Memex preserves it.
Current source version: 0.16.3
Why it matters
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:
- Important 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
The vault organizes memos with:
- Project folders: memos grouped by research project
- Wikilinks: connections across sessions and projects
- Hybrid search: full-text plus optional semantic search
- Knowledge graphs: visualization of 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 --stdin (--replace|--append) --doc-path <memo> | Store extracted observations with an explicit write mode |
memex status / memex check | Vault statistics and crystallization-readiness checks |
memex check --folders | Detect project-folder drift and duplicate/split project folders |
memex check --validate | Lint vault frontmatter for merged keys, missing titles, dangling delimiters, and missing frontmatter |
memex scrub <path> | Detect secrets and optionally redact them with --apply |
memex index vacuum | Reclaim index free pages after vector migrations |
Observation writes now require an explicit mode. --replace deletes the memo's existing observations before storing the submitted set, so send the complete set in one call. Use --append only for a deliberate addition. The result reports replaced and skipped rows, and observation deletion removes the search, vector, and topic rows that mirror it.
As of v0.15.9, memex check also treats projects/<slug>/_project.md overviews as valid targets for bare [[project-slug]] links. That keeps cross-project references from inflating the ghost-node queue while still surfacing folder fragments that lack a real project overview.
As of v0.15.10, memex check ends with a curator-artifact freshness section when the vault has a curator dashboard. It compares the dashboard and curator log with the newest non-archived topic edit, warning when either trails active topic work by more than seven days. Quiet vaults do not generate wall-clock nagging, and the same result is available under curator_artifacts in JSON output.
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 |
Host support
| Host | Support | Notes |
|---|---|---|
| Claude Code (CLI) | Full support | The plugin's native target — hooks, commands, and the curator skill all run. |
| Claude Code (Desktop "Code" tab) | Full support | Same engine; identical behavior. |
| Codex CLI / Codex Desktop | Adjacent support | The plugin runs inside Claude Code, but a Codex session can install it for you cross-host. Ask the Codex agent to run `claude plugin marketplace add linxule/memex-plugin && claude plugin install memex@memex-local --scope user`. Then 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. Run `uv tool install git+https://github.com/linxule/memex-plugin.git` for vault read, search, and write in any shell, just without the auto-save hooks and slash commands. |
| Cursor / other clients | No support | Plugin format is CC-only. |
The vault itself is just an Obsidian folder of markdown files, readable by anything that reads markdown.
Research workflow example
Week 1: You and Claude analyze 20 papers and develop an initial coding framework. Memex captures the framework rationale and which papers mattered most.
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 and curator-practice skills, plus memex ask, surface how your analytical approach evolved across sessions. This gives you the reflexivity narrative for your paper.
Install
Prerequisites
Required
- Claude Code CLI
- Python 3.11+ with uv
Optional
- Obsidian for visual graph navigation
- LM Studio or
GEMINI_API_KEYfor 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-local --scope user
# 3. Restart Claude Code to load hooks
claudeDespite its name, memex-local is also the marketplace identifier declared by the public GitHub repository's .claude-plugin/marketplace.json; it is not limited to local-clone installs. The marketplace source distinguishes the two paths: linxule/memex-plugin uses the public repository, while ~/memex uses your checkout. Both sources install memex@memex-local.
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-local --scope userConfiguration
Create ~/.memex/config.json to customize your vault location:
{
"memex_path": "/path/to/your/memex/vault",
"embeddings": {
"provider": "google",
"model": "gemini-embedding-2",
"dimensions": 3072,
"api_key_env": "GEMINI_API_KEY"
}
}See config.json.example in the plugin repo for all available options.
For smaller vector indexes, v0.15+ can Matryoshka-truncate stored and query vectors by adding "index_dimensions": 768 under embeddings. Existing indexes can migrate with memex index migrate-vec; run memex index vacuum afterward to reclaim disk space.
v0.15+ also moved metadata filters such as --type and --since into the vec0 query path, so semantic search does less post-filtering work.
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
memex session discover --triage
# Import and rebuild index
memex session discover --import --apply
memex index rebuild --incremental
# Score, filter, and import in one pass; exclude a live session by id
memex session discover --triage --min-score=9 --import --apply --exclude 1a2b3c4dVersions 0.16.2–0.16.3 repaired this import path without changing the basic workflow. Sessions opened from hidden directories or worktrees now resolve to the real project rather than a fragment folder; project-name sanitizing is stable across repeated writes; --triage now works when combined with --import; and --exclude no longer corrupts JSON output. The transcript converter now ships inside the installed package and uses the real shared helpers, so imports log consistently and cannot revive the older naming bugs through fallback code.
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
memex index rebuild --fullPart of Research Memex
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 system where memos live.
- Claude Code Setup Guide: The research environment where Memex operates.
cite this page
Lin, X. (2026). Memex Plugin: Persistent Research Memory. Research Memex. https://research-memex.org/docs/toolkit/memex-plugin
@misc{docs-toolkit-memex-plugin-2026,
author = {Xule Lin},
title = {Memex Plugin: Persistent Research Memory},
year = {2026},
howpublished = {\url{https://research-memex.org/docs/toolkit/memex-plugin}},
note = {ORCID: 0000-0001-7885-4194}
}one renderingthe source remains