obsidian-reindex

obsidian-reindex is a command for Claude Code from eugeniughelbur/obsidian-second-brain. It costs 13 tokens per session (720 once invoked), scanned A, original, MIT.

A command that refreshes Obsidian’s semantic search index, which helps find notes by meaning rather than only matching words.

In plain words
What is it for?
Use it to update an Obsidian vault’s semantic search index and report how many notes are indexed, scanned, or missing.
Why use it?
It shows how complete the index is before and after the refresh, so you can see whether notes are missing from search. It only reprocesses new or changed notes.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is uv run --directory "SKILL_ROOT" python scripts/eval/semantic_search.py --path "VAULT_PATH" --build.

Part of the obsidian-second-brain plugin — 1 skill, 47 commands, 3 hooks shipped together

Good fit Use it to update an Obsidian vault’s semantic search index and report how many notes are indexed, scanned, or missing.

Compare 6 commands from other repositories ↓
About the project

obsidian-second-brain turns an Obsidian vault into persistent, searchable memory for Claude Code and other command-line coding agents, storing knowledge as linked Markdown notes. It is for developers, founders, writers, and researchers who want agents to retain project context across sessions. Its catalogue entries provide commands, hooks, a plugin, a skill, and instructions for capturing, finding, and maintaining that memory.

eugeniughelbur/obsidian-second-brain · 4,392 stars · on GitHub · eugeniughelbur.github.io

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/eugeniughelbur/obsidian-second-brain
agentmods
npx agentmods add commands/eugeniughelbur/obsidian-second-brain/obsidian-reindex

Made for: Claude Code.

Or install obsidian-second-brain, the plugin that ships this one along with the rest of its 1 skill, 47 commands, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for obsidian-reindex

README.md
[![agentmods](https://agentmods.dev/badge/commands/eugeniughelbur/obsidian-second-brain/obsidian-reindex/github.svg)](https://agentmods.dev/commands/eugeniughelbur/obsidian-second-brain/obsidian-reindex)
Your own site
<a href="https://agentmods.dev/commands/eugeniughelbur/obsidian-second-brain/obsidian-reindex"><img src="https://agentmods.dev/badge/commands/eugeniughelbur/obsidian-second-brain/obsidian-reindex/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for obsidian-reindex

Your own site · 80×15
<a href="https://agentmods.dev/commands/eugeniughelbur/obsidian-second-brain/obsidian-reindex"><img src="https://agentmods.dev/badge/commands/eugeniughelbur/obsidian-second-brain/obsidian-reindex.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 720 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.00720
Opus 5 $0.00006 $0.00360
Sonnet 5 $0.00003 $0.00144
Haiku 4.5 $0.00001 $0.00072

Measured 12d ago against content hash dbc88b10d234, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

obsidian-reindex scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/obsidian-reindex.md · 41 lines

What it actually says

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:

    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:

    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.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 41 lines · 13 tokens per session scan A dbc88b10d234

Subscribe to this mod's changes

obsidian-reindex is a command published in the GitHub repository eugeniughelbur/obsidian-second-brain (4,392 stars, last pushed 4d ago), licensed MIT. It adds 13 tokens to every session and 720 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.