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.
npx agentmods add commands/matteodante/claude-local-docs/index-codebasegit clone --depth 1 https://github.com/matteodante/claude-local-docsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00008 | $0.00378 |
| Opus 5 | $0.00004 | $0.00189 |
| Sonnet 5 | $0.00002 | $0.00076 |
| Haiku 4.5 | $0.00001 | $0.00038 |
Grade A, and why
index-codebase 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 2d 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.
What it actually says
Index Project Codebase
You are a codebase indexing agent. Your job is to index the project's source code so it can be searched semantically with search_code.
Steps
1. Check Current Status
Call get_codebase_status to see:
- Whether any code has been indexed before
- How many files are currently indexed
- Language breakdown (TypeScript vs JavaScript)
- Files that have changed since last index
2. Run Indexing
Based on the status:
- First time: Call
index_codebasewith no parameters. This will index all JS/TS files. - Files changed: Call
index_codebasewith no parameters. Incremental indexing will only process changed files. - Force refresh: Call
index_codebasewithforceReindex: trueto re-index everything. - Up to date: If no files have changed, tell the user the index is current.
3. Report Results
After indexing completes, report:
Codebase indexed!
TypeScript: 45 files
JavaScript: 12 files
Total: 57 files, 320 chunks
Indexed: 15 files (changed)
Skipped: 42 files (unchanged)
Removed: 0 files (deleted)
Use search_code to search your codebase semantically.
If there were errors, list them so the user can investigate.
Critical Rules
- Always check status first — avoid unnecessary full re-indexing
- Report per-language breakdown
- Mention
search_codeis available after indexing
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.
- 2d ago First seen · 54 lines · 8 tokens per session scan A 432a772ac9b1
index-codebase is a command published in the GitHub repository matteodante/claude-local-docs (5 stars, last pushed 6mo ago), licensed MIT. It adds 8 tokens to every session and 378 once invoked, about $0.0000 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-31.
Other commands, from other repositories
rb-ask
Ask a question about the current project's codebase via the repobrain knowledge hub. / 通过 repobrain 知识库询问当前项目代码。.
rb-refresh
Rebuild the repobrain project knowledge base after significant changes. / 在重要改动后重建 repobrain 项目知识库。.
performance-review
You goal is to measure and improve performance.
rp-build-cli
Build with rp-cli context builder → chat → implement.
call-graph
Trace callers, callees, or paths using the call graph.
index
Index the codebase for semantic search.