/memex-claude:helpfrom memex-claude
Show how to use memex: what it does, how to create skills/rules/memories, available commands, current status, and troubleshooting.
Ships in memex-claude. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Memex injects relevant knowledge into your session based on what you're working on. Instead of loading everything into context at once, it uses semantic similarity to surface only what's needed right now.
Each prompt you type is embedded locally (ONNX, no API calls) and compared against your indexed skills, rules, and memories. The top matches are injected as additional context. Match counts are tracked via telemetry (~/.claude/cache/memex-telemetry.json).
Entry types and disclosure model:
| Type | First match | Subsequent matches | Matched on |
|---|---|---|---|
rule | Full content | one-liner reminder only | UserPromptSubmit |
memory | Full content | Full content | UserPromptSubmit |
skill | Description teaser | Full content (via Read) | UserPromptSubmit |
workflow | Description teaser | Full content (via Read) | UserPromptSubmit |
tool-guidance | Full content | Full content | PreToolUse |
stop-rule | Behavioral rules | — | Stop |
session-learning | Full content | Full content | UserPromptSubmit |
| Command | Description |
|---|---|
/sleep | Knowledge lifecycle: migrate CLAUDE.md/MEMORY.md/rules into skills, promote/demote entries based on match telemetry |
/deep-sleep | Analyze past session transcripts to extract recurring patterns, classify into appropriate types |
/reflect | Extract learnings from the current conversation and save as memories, rules, or skills |
/doctor | Diagnose installation and configuration issues |
/handoff | Write a continuation plan to disk so a fresh session can pick up where this one left off |
/takeover | Read a handoff document and resume the work |
/help | This guide |
Create ~/.claude/skills/<name>/SKILL.md (global) or <project>/.claude/skills/<name>/SKILL.md (project):
---
name: my-skill
description: "What this skill does"
queries:
- "when would someone need this"
- "another example query"
boost: 0.05 # optional: nudge score for entries near the threshold
---
The skill content.
Create ~/.claude/rules/<name>.md (global) or <project>/.claude/rules/<name>.md (project):
---
name: my-rule
description: "What this rule enforces"
type: rule
one-liner: "Short reminder for subsequent matches"
queries:
- "when this rule applies"
---
Full rule content shown on first match.
Rules without frontmatter work too — filename becomes name, first line becomes description.
Memories live in ~/.claude/projects/<encoded-cwd>/memory/*.md (where <encoded-cwd> is the cwd with / → - and . → -).
Use ## headings for each entry and optionally add Triggers: lines for better semantic matching:
## Prefer pnpm
Triggers: install dependencies, npm install, which package manager
Use `pnpm` instead of `npm` for all operations.
Use /sleep to convert accumulated MEMORY.md entries into searchable skills, and /reflect to extract learnings from the current conversation.
Run these to inspect memex's current state:
# Config (or defaults if no file)
cat ~/.claude/memex.json 2>/dev/null || echo "Using defaults"
# What's indexed — global
ls ~/.claude/skills/*/SKILL.md 2>/dev/null
ls ~/.claude/rules/*.md 2>/dev/null
# What's indexed — this project
ls .claude/skills/*/SKILL.md 2>/dev/null
ls .claude/rules/*.md 2>/dev/null
# Memories for this project
ls ~/.claude/projects/*/memory/*.md 2>/dev/null
# Cache status
ls -la ~/.claude/cache/memex-cache.json 2>/dev/null
# Match telemetry
cat ~/.claude/cache/memex-telemetry.json 2>/dev/null
# Model cache
ls ~/.claude/cache/models/ 2>/dev/null
Create ~/.claude/memex.json to customize. All fields optional — defaults shown:
{
"enabled": true,
"embeddingModel": "Xenova/all-MiniLM-L6-v2",
"cacheTimeMs": 300000,
"skillDirs": [],
"sync": {
"enabled": false,
"repo": "",
"autoPull": true,
"autoCommitPush": true,
"projectMappings": {}
},
"sleepSchedule": {
"enabled": false,
"dailyAt": "03:00",
"projects": []
},
"hooks": {
"UserPromptSubmit": {
"enabled": true,
"topK": 3,
"threshold": 0.5,
"maxInjectedChars": 8000,
"types": ["skill", "memory", "workflow", "session-learning", "rule"]
},
"PreToolUse": {
"enabled": false,
"topK": 2,
"threshold": 0.6,
"maxInjectedChars": 4000,
"types": ["tool-guidance", "skill"]
},
"Stop": {
"enabled": false,
"extractLearnings": true,
"behavioralRules": true
}
}
}
Key tuning knobs:
threshold — lower to match more broadly (default 0.5), raise for precisiontopK — how many matches to inject per prompt (default 3)maxInjectedChars — character budget for injected content (default 8000)sync — enable cross-machine sync via a private git repo (see README)| Symptom | Check |
|---|---|
| Nothing is being injected | Are there skills/rules/memories in the scan paths? (see "Check status" above) |
| Wrong things are injected | Adjust threshold higher, or improve queries in your SKILL.md frontmatter |
| Skill barely misses threshold | Add boost: 0.05 to frontmatter to nudge its score up |
| Queries feel stale or ineffective | Run /sleep — it evolves weak queries based on queryHits telemetry |
| Everything is injected | threshold may be too low, raise it (e.g. 0.6) |
| Slow first run | Model download (~23MB), needs internet access |
| Stale results after editing skills | Delete ~/.claude/cache/memex-cache.json to force rebuild |
| Hook not running at all | Check ~/.claude/settings.json for the hook registration |
$ARGUMENTS
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jim80net/memex-claude --plugin memex-claude9 skills in this plugin
/deep-sleepExtract learnings from past session transcripts and create appropriately-typed skills. Processes unreviewed sessions to find user preferences, recurring patterns, and troublesome workflows./doctorDiagnose and fix memex installation, setup, or runtime problems. Run checks on the binary, config, hooks, cache, model, and scan paths./handoffCreate a comprehensive continuation plan so a fresh session can pick up exactly where this one left off — with full operational detail, not summaries./memory-creationInstructions for creating and managing memories in memex format (injected in takeover mode)/reflectExtract learnings from the current conversation and save them as memories, rules, or skills so future sessions benefit from what happened here./sleepManage the sleep cycle: migrate MEMORY.md, CLAUDE.md, and rules into semantically-searchable skills, and promote/demote entries based on match telemetry.Other plugins' skills for the same job