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.
git clone --depth 1 https://github.com/iliaal/codesageWrote 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.
[](https://agentmods.dev/commands/iliaal/codesage/codesage-reindex)<a href="https://agentmods.dev/commands/iliaal/codesage/codesage-reindex"><img src="https://agentmods.dev/badge/commands/iliaal/codesage/codesage-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.
<a href="https://agentmods.dev/commands/iliaal/codesage/codesage-reindex"><img src="https://agentmods.dev/badge/commands/iliaal/codesage/codesage-reindex.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00028 | $0.00872 |
| Opus 5.5 | $0.00011 | $0.00349 |
| Sonnet 5.5 | $0.00006 | $0.00174 |
| Haiku 4.5 | $0.00003 | $0.00087 |
Grade A, and why
codesage-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 27d 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.
How it starts
The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refresh a CodeSage index
Resolve $ARGUMENTS to an absolute project path, defaulting to the current directory. Require .codesage/index.db; otherwise direct the user to /codesage-onboard. Run commands from that project directory.
Before touching .codesage/, reject symlinked directories and symlinked or non-regular leaves, including configuration, database companions, and indexing.lock. Use test -L to detect dangling links as well. Do not follow repository-controlled links when capturing state or running maintenance.
Capture the baseline
Run codesage status --json. Record files, chunks, and semantic.model. These are retained index totals, not the amount processed by the next indexing pass. Preserve any status failure; do not substitute zero for an unavailable baseline.
Index
Run codesage index --lock-wait 30. This uses the project's indexing lock, waiting up to 30 seconds for an existing writer. Exit 75 means contention prevented the pass; report it without claiming an index refresh. Do not remove the lock file or database to bypass contention.
Read both the exit status and the structural/semantic summaries. A successful process can still report failed files. Report named failures, syntax-error recovery counts, and whether further work is needed. If the operation takes more than 30 seconds, use the host's background process handle and poll that same handle.
The index summaries describe this pass:
Structural: N files (X skipped, Y failed, Z removed), S symbols, R referencesrecords structural work performed. An optionalD parsed with syntax errorssuffix identifies recovered parses, not failed files.Semantic: N files (X skipped, Y failed, Z removed), C chunksrecords semantic work performed. C is chunks created during this pass, not the retained index total.- Feature and trust-boundary summaries describe their own work; preserve their failures and warnings too.
Clean orphan tables after successful indexing
Only after indexing succeeds without failed files, run codesage cleanup --dry-run. Its Active model: and Active table: identify the configured model, keep: identifies its table, and DRY-RUN drop: identifies orphan tables.
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.
- 27d ago Changed ab3b7bdbd939
- 1mo ago Changed · -33 lines · -5 tokens per session 6f8627643786
- 1mo ago Changed · +2 lines fde26c5a7715
- 1mo ago First seen · 77 lines · 33 tokens per session scan A 475167c1d806
codesage-reindex is a command published in the GitHub repository iliaal/codesage (21 stars, last pushed yesterday), licensed MIT. It adds 28 tokens to every session and 872 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-08-30.
Other commands, from other repositories
call-graph
Trace callers, callees, or paths using the call graph.
peek
Quickly find likely code locations without returning full code.
definition
Find where a symbol is defined in the codebase.
find
Find code using hybrid approach (semantic + grep).
status
Check if the codebase is indexed and ready for semantic search.
doctor
Diagnose the Repowise setup — install, API keys, index/store drift — and optionally repair it.