Skip to main content
command CX Codex

obsidian-reindex — Claude Code command: rebuild semantic index

obsidian-reindex refreshes the semantic search index for an Obsidian vault and reports how many notes are indexed before and after. Runs fast on subsequent calls because it only embeds new or modified notes.

MIT ★ 5,412 updated 2026-10-24

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add eugeniughelbur/obsidian-second-brain
/plugin install obsidian-second-brain@obsidian-second-brain
Open on GitHub

What obsidian-reindex does

The command updates .obsidian-semantic-index.json, the index used for semantic search. It runs a Python script from eugeniughelbur/obsidian-second-brain. First it measures how many notes are currently indexed and how many are missing, then rebuilds the index, then reports the new state. If the rebuild fails, the command stops and shows the error from Ollama so you know what to fix.

The vault itself stays unchanged—only the index is updated. Any notes that fail to index, are excluded, or degrade during the rebuild are listed separately, so you can see which ones won't be fully searchable by meaning.

On the first run, you need Ollama running with an embedding model already pulled. Subsequent runs reuse the model and only embed what's new or changed.

What it helps with

  • Refresh the semantic index after adding notes to Obsidian
  • Check how many notes in the vault are indexed for semantic search
  • Rebuild embeddings after changing the embedding model or configuration

Example prompts for the agent

  • Rebuild the semantic index in my Obsidian vault
  • Update the search index to include new notes
  • Show me the index coverage before and after the rebuild

How to install obsidian-reindex

1Plugin marketplace

/plugin marketplace add eugeniughelbur/obsidian-second-brain
/plugin install obsidian-second-brain@obsidian-second-brain

2Manually: put the files in place

.claude/commands/obsidian-reindex.md

Call it with /obsidian-reindex. For all projects use ~/.claude/commands/

Questions about obsidian-reindex

How do I install obsidian-reindex in Claude Code?

Run /plugin marketplace add eugeniughelbur/obsidian-second-brain, then /plugin install obsidian-second-brain@obsidian-second-brain. Copy .claude/commands/obsidian-reindex.md from the repository into your project's .claude/commands folder.

What does obsidian-reindex do?

It rebuilds the semantic search index, shows the number of indexed notes before and after, and lists any notes that failed to index, were excluded, or degraded during the rebuild.

What do I need to run this command?

You need Ollama running with an embedding model pulled. If Ollama isn't running or the model isn't loaded, the command stops and shows which model is needed and how to fix it.

Source text

obsidian-reindex.md · MIT
---
description: Refresh the vault's semantic search index and report coverage before and after
category: meta
triggers_en: ["reindex vault", "rebuild semantic index", "refresh semantic search", "update vault embeddings"]
triggers_de: ["Vault neu indexieren", "semantischen Index neu erstellen", "semantische Suche aktualisieren", "Vault-Einbettungen aktualisieren"]
triggers_es: ["reindexa el vault", "reconstruye el índice semántico", "actualiza la búsqueda semántica", "actualiza los embeddings del vault"]
triggers_pt: ["reindexe o vault", "reconstrua o índice semântico", "atualize a busca semântica", "atualize os embeddings do vault"]
triggers_zh: ["重建知识库索引", "刷新语义搜索", "更新笔记向量", "重新索引我的知识库"]
---

Use the obsidian-second-brain skill. Execute `/obsidian-reindex`:

The semantic index is incremental. An existing, current index is cheap to refresh because only new and changed notes are embedded again.

1. Read `_CLAUDE.md` first to find the vault path. Resolve it to an absolute path and substitute it for `VAULT_PATH` below. The skill root was given at session start as **Skill root**; substitute its absolute path for `SKILL_ROOT`.

2. Measure coverage before changing the index:
   ```bash
   uv run --directory "SKILL_ROOT" python -c 'import json, sys; from pathlib import Path; sys.path.insert(0, str(Path(sys.argv[1]) / "integrations" / "obsidian-mcp-server")); from vault_ops import index_coverage; print(json.dumps(index_coverage(Path(sys.argv[2]).expanduser().resolve())))' "SKILL_ROOT" "VAULT_PATH"
   ```
   Report `indexed`, `scanned`, `missing`, and `pct_missing`. If `index` is false, say that no readable semantic index exists yet instead of presenting `0/0` as coverage.

3. Tell the user that the build is incremental, then run it from the skill root:
   ```bash
   uv run --directory "SKILL_ROOT" python scripts/eval/semantic_search.py --path "VAULT_PATH" --build
   ```
   Preserve the command's exit status and capture its stderr. If it exits nonzero, stop and show the actionable backend error. Do not claim the index was refreshed and do not report an after-state as success. The common failure is Ollama not running or the configured embedding model not being pulled; use the runtime and model named by the command's own output rather than assuming the defaults.

4. On success, run the coverage command from step 2 again.

5. Report the result:
   - Coverage before and after as `indexed/scanned`, with missing count and percentage
   - The builder's `new` count from its `[semantic] indexed ...` summary as notes newly embedded or refreshed
   - Cached, excluded, degraded, and dropped counts when nonzero
   - Every degraded or dropped path printed by the builder, because those notes are not fully searchable by meaning

If coverage did not improve, say so plainly and use the builder output to distinguish a current index from failed or excluded notes. This command updates only `.obsidian-semantic-index.json`; it does not modify Markdown notes.

---

**Anti-fabrication:** Report coverage and build counts exactly as the tools emit them. Never infer a successful refresh from an unchanged file or a zero exit status alone when the builder reports dropped notes.

© Eugeniu Ghelbur · MIT · eugeniughelbur/obsidian-second-brain

Similar slash commands

All slash commands for Notes, tasks and projects →

From the same set51

The whole set →
obsidian-project Creates or updates an Obsidian project note, then links it to a board and the daily note. It fits vaults that track projects through structured notes. CX Codex +1 ★ 5,412repo stars obsidian-review obsidian-review — a command that generates a structured report of work completed over a week or month by reading daily notes, logs, projects, and task completion data from your Obsidian vault. CX Codex +1 ★ 5,412repo stars obsidian-recap obsidian-recap summarizes Obsidian vault activity for today, the week, or the month. It uses parallel subagents to process daily notes, dev logs, and kanban tasks into a structured recap. CX Codex +1 ★ 5,412repo stars obsidian-recurring obsidian-recurring is a command that tracks recurring payments or obligations in Obsidian and calculates the next due date. It links tasks to a board, project note, and log. CX Codex +1 ★ 5,412repo stars x-pulse x-pulse scans X via Grok x_search for topic trends, popular angles, and post ideas, then saves the research note to your vault. CX Codex +1 ★ 5,412repo stars obsidian-connect obsidian-connect — a command that connects two unrelated domains through your Obsidian vault's link graph. Discovers unexpected intersections and generates concrete ideas at their convergence. CX Codex +1 ★ 5,412repo stars idea-discovery idea-discovery surfaces 3–5 next-direction candidates by reading ungraduated ideas, open project questions, and orphan research notes in your Obsidian vault. CX Codex +1 ★ 5,412repo stars obsidian-challenge The obsidian-challenge command for Claude Code compares a plan with your Obsidian vault history to find past errors, risks, and contradictions. CX Codex +1 ★ 5,412repo stars

Project sponsors

Companies that keep this analytics open