| name | reindex |
| description | This skill should be used when the user asks to "rebuild the memory index", "reindex memory", says the INDEX.md is drifted or out of sync with the notes (e.g. after a merge conflict), or invokes /tm:reindex [global]. Rebuilds the "## Notes" list of a scope's INDEX.md from note frontmatter and Gist lines; index frontmatter is preserved verbatim — identity fields are never rewritten. Confirms before dispatching the rebuild. |
| argument-hint | [global] |
tm — rebuild an INDEX.md Notes list
Guard (run first, always)
Run ${CLAUDE_PLUGIN_ROOT}/scripts/tm-guard.sh "$PWD" and read its KEY=VALUE output.
If TM_STATUS is not OK, stop and follow the repair flows in <MEMORY_DIR>/references/bootstrap.md
(if the store does not exist yet, the same file ships in the plugin at
${CLAUDE_PLUGIN_ROOT}/references/bootstrap.md). Do not continue until the guard prints
TM_STATUS=OK. Keep MEMORY_DIR, PROJECT_ID, and PROJECT_PATH for the steps below.
Steps
-
Resolve the scope. Default scope is the current project:
<MEMORY_DIR>/<PROJECT_PATH>/. Only when the user explicitly passed the argument global
is the scope <MEMORY_DIR>/global/. For project scope, if PROJECT_EXISTS=false there is
no index to rebuild — stop and follow the project-creation flow in bootstrap.md.
-
Confirm. State the scope whose ## Notes list will be regenerated and confirm via
AskUserQuestion (rebuild / cancel) — always, and especially when this skill auto-triggered
from a description match rather than an explicit /tm:reindex.
-
Dispatch tm-archivist via the Task tool. Pass exactly the agent's input contract in
the prompt:
mode: reindex
memory_dir: <MEMORY_DIR>
- project scope:
project_path: <PROJECT_PATH> and project_id: <PROJECT_ID>
- global scope:
project_path: global and project_id: global
The rebuild procedure (index frontmatter preserved byte-for-byte — key and
last_consolidated never rewritten — heading and [[MEMORY.md]] pointer kept, ## Notes
regenerated newest-first from note frontmatter and verbatim Gist lines, malformed notes
flagged not fixed) lives in the tm-archivist prompt — do not restate or override it here.
-
Relay the report to the user. Do not commit — the rebuilt index is swept into the next
mem(<project-id>): <gist> store commit (e.g. by /tm:consolidate or a durable
/tm:remember).
When to run
- After resolving a git merge conflict in the newest-first
INDEX.md (merge first, then
reindex).
- When index rows have drifted from note Gist lines, or notes exist with no index row.
Codex note
Reindex is not installed on Codex — run /tm:reindex from Claude Code. (If an index must be
repaired from a Codex-only host, the rebuild rules are in the store's
references/index-format.md.)
Additional resources
<MEMORY_DIR>/references/index-format.md — the authoritative index format.
<MEMORY_DIR>/references/note-format.md — the frontmatter fields read per note.