/memex:reindex [--force] [--hub <hub-name>]from memex
Rebuilds every hub's _CLOSETS.md index from scratch for Memex v2 retrieval. Use after bulk imports or v1-to-v2 upgrades.
Ships in memex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Wikilink rule: When referencing any file in markdown, always use [[filename]] wikilink format.
Walk every Tier 2 hub in _MANIFEST.md and (re)generate _CLOSETS.md for each. Session-end refreshes touched hubs incrementally; reindex covers the long tail in one pass.
Picking the right migration tool:
/memex:resummarize. Rewrites manifest + hub summaries to v2 format./memex:reindex. Rebuilds the per-hub closets index used for retrieval.Run resummarize for summary format upgrades, reindex for closets coverage. They're independent; on a fresh v1→v2 migration, run resummarize first, then reindex.
Run WORKSPACE_ROOT=$(pwd) && echo "$WORKSPACE_ROOT" via Bash. Read _MANIFEST.md:
<!-- memex-managed marker: Tell the user "Memex isn't initialized here. Run /memex:init first." and stop.Acquire memory/.reindex.lock and check the 24-hour cooldown in memory/.reindex-runs.log. Both follow the shared bulk-write convention. See ../consolidate/references/locking.md.
Parse $ARGUMENTS:
--hub <name>. Limit to one hub (e.g., --hub fundraising). Useful for spot rebuilds.--force. Rebuild every entry from scratch, ignoring mtime checks. Also bypasses the 24-hour cooldown.Read _MANIFEST.md. For each row in the Hub Map, parse the wikilink in the Hub column:
[[<domain>-index]]. Hub folder = parent of the index file. Closets file: <hub-folder>/_CLOSETS.md.[[<domain>/_CLOSETS]] (v2.1+). Hub folder = the parent folder of the closets file. No index file expected.Resolve absolute paths for each hub folder and its closets / archive. Archive (if any): <hub-folder>/_CLOSETS-archive.md.
Also include memory/ as a synthetic hub. Its closets file is memory/_CLOSETS.md; its files are the Tier 1 files listed in _MANIFEST.md (status, session-log, decisions, glossary, plus any user-added Tier 1 entries). The memory hub has no archive (Tier 1 is a small fixed set, not paginated).
If --hub <name> was passed, filter to that hub. --hub memory reindexes the Tier 1 closets only.
Enumerate the hub's member files:
.md file in the hub folder, excluding _CLOSETS.md and _CLOSETS-archive.md. The folder contents are the canonical members..md files. Union of the two is the canonical member list.In both cases, also flag any files on disk that aren't yet represented in _CLOSETS.md (orphans). Reindex includes orphans by default and surfaces them in the report.
For each file:
/memex:lint reports dangling hub-table entries separately).stat._CLOSETS.md has a current entry (closets file's mtime more recent than the underlying file's) and --force was not passed.For each queued file, read content and write a typed-field closets entry. The format and the eight retrieval-tuned summary rules that drive each field live with session-end:
../session-end/references/closets-format.md../session-end/references/summary-rules.mdReindex applies them verbatim. Do not deviate.
For each hub, after generating entries:
_CLOSETS.md._CLOSETS-archive.md, prepended above existing archive content (never overwrite older archive entries).<!-- memex-closets:1.1 -->._CLOSETS-archive.md is created for the first time, add [[<hub>-CLOSETS-archive]] to the Tier 3 table of _MANIFEST.md._CLOSETS.md listing the top 5 most recently demoted file stems (one line each: [[stem]] — <subjects fragment>, last touched <date>). This keeps the archive's existence and recent contents surfaced in the always-loaded layer without bloating retrieval. Section is purely informational; field-level retrieval still uses the 30 primary entries.If a hub has ≤ 30 files, write only _CLOSETS.md with marker <!-- memex-closets:1.0 --> and no Recently Archived section.
The memory/ hub never paginates (small fixed set). Skip steps 1-6 there; just write all entries to memory/_CLOSETS.md with marker <!-- memex-closets:1.1 -->.
Run ${CLAUDE_SKILL_DIR}/scripts/verify-wikilinks.py against the workspace to confirm no closets entry references a missing file. List broken entries in the report; don't auto-delete.
Then refresh the typed-edge graph (no longer rebuilt at session-end):
${CLAUDE_SKILL_DIR}/scripts/extract-graph.py against the workspace path. It writes memory/.graph.md.Skip if the script is unresolvable. Typed edges are opt-in.
Append to memory/.reindex-runs.log:
YYYY-MM-DDTHH:MM:SS hubs=<N> files=<K> refreshed=<R> skipped=<S> status=<ok|partial>
Clear memory/.reindex.lock. Output:
Memex Reindex Report
Hubs processed: <N>
<hub-name>: <K> files indexed (<refreshed> refreshed, <skipped> already current)
<P> primary entries, <A> archived (if pagination triggered)
...
Orphans found (in folder but not in hub table):
<hub-name>/<file.md> -- consider adding to [[<hub>-index]]
...
Closets issues: [PASS / N dangling references]
...
Total time: <Ts>
Append a one-line entry to memory/session-log.md if Memex is in full mode (skip in compatible mode):
## YYYY-MM-DD - /memex:reindex
- Reindexed <N> hubs, <K> files. <refreshed> refreshed, <skipped> already current.
- <orphans> orphans surfaced; <issues> closet issues to resolve.
---
--hub <name> to scope when iterating._CLOSETS.md and _CLOSETS-archive.md. Orphans surface for user action, not auto-add.--force rebuilds every entry from scratch. Use after a closets format change, or if existing entries look wrong. Otherwise the mtime check is enough._CLOSETS.md may cause some entries to skip on the next reindex. Pass --force if that matters./memex:lint. Reindex is the bulk-write counterpart to lint's read-only audit./memex:resummarize. It operates on manifest and hub summaries, not on closets.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub skyfox-io/memex --plugin memex17 skills in this plugin
/add-domainAdds a new domain folder with a hub index and wires it into `_MANIFEST.md` -- for a new topic area, or splitting an existing domain into its own folder.
/archiveMoves a file from active (Tier 2) to archived (Tier 3) so Memex stops loading it automatically -- for a wrapped project, a stale reference, or a superseded file. The file stays on disk; only its manifest tier and hub status change.
/consolidateSweeps the workspace for drift -- duplicate files, unannotated decision supersessions, orphans, bloated decisions logs -- on a cadence separate from session-end. Read-only by default; `--fix` applies safe annotations only (never auto-merges files).
/cross-searchTrigger when the user's question spans multiple Memex workspaces and they don't know which one holds the answer, or they ask "have I written about X anywhere?". Not for questions the current workspace can answer -- use `/memex:search` instead. Reads only manifests and closets, never inside individual files.
/ideaQuick-capture an idea to the scratch inbox. Use when the user explicitly asks to capture: "capture this", "add to ideas", "don't let me forget", "log this idea", `/memex:idea`. Not for every "we should eventually..." aside -- most asides aren't capture-intent. Not for decisions (decisions.md) or state claims (closets `claims:` field).
/initSets up Memex in the current workspace. Detects state -- fresh repo, existing repo with loose markdown, a foreign manifest, or an outdated version marker -- and runs the right combination of scaffold, scan-and-organize, migrate, or health-check.
Other plugins' skills for the same job