kb-reindex

kb-reindex is a command for Claude Code from mathiasbourgoin/roster. It costs 20 tokens per session (1,425 once invoked), scanned A, original, MIT.

An index builder for a project's knowledge base, creating or updating a search cache from its files. The original Markdown files remain the authoritative source, while the index supports later searches.

In plain words
What is it for?
It is for building or refreshing the search index used to find project notes and references by meaning or keywords.
Why use it?
It makes a knowledge base searchable without repeatedly reading every file. Incremental updates can refresh the cache as documentation changes.

Command for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: reads .claude/ paths; mentions OpenCode.

Part of the roster plugin — 40 commands, 8 agents shipped together

Good fit It is for building or refreshing the search index used to find project notes and references by meaning or keywords.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/mathiasbourgoin/roster/kb-reindex
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/mathiasbourgoin/roster

Made for: Claude Code.

Or install roster, the plugin that ships this one along with the rest of its 40 commands, 8 agents.

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 kb-reindex

README.md
[![agentmods](https://agentmods.dev/badge/commands/mathiasbourgoin/roster/kb-reindex/github.svg)](https://agentmods.dev/commands/mathiasbourgoin/roster/kb-reindex)
Your own site
<a href="https://agentmods.dev/commands/mathiasbourgoin/roster/kb-reindex"><img src="https://agentmods.dev/badge/commands/mathiasbourgoin/roster/kb-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 kb-reindex

Your own site · 80×15
<a href="https://agentmods.dev/commands/mathiasbourgoin/roster/kb-reindex"><img src="https://agentmods.dev/badge/commands/mathiasbourgoin/roster/kb-reindex.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,425 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.00020 $0.01425
Opus 5.5 $0.00008 $0.00570
Sonnet 5.5 $0.00004 $0.00285
Haiku 4.5 $0.00002 $0.00143

Measured 1mo ago against content hash 56691164441b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kb-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 1mo 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.

.claude/commands/kb-reindex.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

KB Reindex

You build or incrementally update a LanceDB vector index over the project's kb/ directory. This skill is opt-in — only run when search_index: true is set in the project's kb-agent tunable, or when explicitly invoked.

The index is a search cache. Markdown files remain the primary source of truth. The index is never committed to git.

Pre-conditions

# Opt-in flag lives in the installed kb-agent's frontmatter tunables (the file /roster-config
# edits) — NOT in .harness/harness.json, whose agents[].tunables carry no per-agent values.
AGENT_FILE=""
for f in .harness/agents/kb-agent.md .claude/agents/kb-agent.md .opencode/agents/kb-agent.md agents/management/kb-agent.md; do
  [ -f "$f" ] && AGENT_FILE="$f" && break
done
grep -Eq '^[[:space:]]*search_index:[[:space:]]*true' "$AGENT_FILE" 2>/dev/null \
  && echo "search_index: enabled ($AGENT_FILE)" \
  || echo "search_index: disabled — enable via /roster-config (kb-agent › search_index), or proceed only on explicit user request"
# Check LanceDB is available (Python: pip install lancedb; JS: npm install @lancedb/lancedb)
[ -d kb ] && echo "KB present" || echo "KB absent — nothing to index"

If kb/ is absent: report and stop.

Read the configured embedding_mode before doing any network or credential check:

  • remote (default): use the configured embedding provider and model.
  • disabled: report semantic index disabled; Markdown and deterministic claims remain available and stop successfully without creating or changing kb/.index/.

Index availability is optional and MUST NOT affect claims validation, dependency closure, projection freshness, spec compliance, or any mandatory Roster gate. Never silently replace a disabled or failed embedding provider with agent-generated similarity judgments.

Migration warning: if any KB file lacks schema-version: 2 in frontmatter, emit:

⚠️ Some KB files have not been migrated to schema v2. Run /kb-migrate first for best results. Continuing anyway — legacy files will be indexed with status inferred from old values.

Read the full file on GitHub · 127 lines

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. 1mo ago First seen · 127 lines · 20 tokens per session scan A 56691164441b

Subscribe to this mod's changes

kb-reindex is a command published in the GitHub repository mathiasbourgoin/roster (2 stars, last pushed 2d ago), licensed MIT. It adds 20 tokens to every session and 1,425 once invoked, about $0.0001 per session on Opus 5.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-09-07.