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-reset)<a href="https://agentmods.dev/commands/iliaal/codesage/codesage-reset"><img src="https://agentmods.dev/badge/commands/iliaal/codesage/codesage-reset/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-reset"><img src="https://agentmods.dev/badge/commands/iliaal/codesage/codesage-reset.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.00029 | $0.01172 |
| Opus 5.5 | $0.00012 | $0.00469 |
| Sonnet 5.5 | $0.00006 | $0.00234 |
| Haiku 4.5 | $0.00003 | $0.00117 |
Grade A, and why
codesage-reset 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 24d 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 — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rebuild a CodeSage index
Use a full rebuild after parser upgrades, embedding model or pooling changes, or CPU/GPU device changes. It reparses source and regenerates embeddings without unlinking the live SQLite database. For an ordinary incremental refresh, use /codesage-reindex.
Resolve the project and authority
Resolve $ARGUMENTS to an absolute project path, defaulting to the current directory. Require an existing .codesage directory and configuration. Run commands from that project directory.
Before touching any .codesage/ path, reject symlinked directories and symlinked or non-regular leaves. Check with test -L, which detects dangling links too. Include the database, its -wal and -shm companions, indexing.lock, configuration, and watcher markers. Use freshly generated backup or temporary names.
An explicit request to reset this project or --yes authorizes the ordinary full rebuild; do not ask again. If authority is missing, describe the target and full embedding cost before requesting it. Do not promise a fixed duration.
Capture the baseline
Run codesage status --json and record retained files and chunks, plus semantic freshness. If status fails, preserve the exact error and classify it before proceeding. An embedding/configuration error does not prove database corruption. Use the offline recovery section only for a confirmed unreadable or incompatible database that cannot be rebuilt in place.
Rebuild in place
Run:
codesage index --full --lock-wait 30
The command acquires the project's writer lock before opening the database. It waits up to 30 seconds for another writer, including the watcher. Exit 75 means contention prevented the rebuild; report that outcome and retry only after the holder finishes. Never delete the database or lock file to bypass contention.
Keep the same process handle when waiting for a long-running rebuild. Read the structural and semantic failed-file counts as well as the exit status; a zero exit status with failed files is a partial rebuild.
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.
- 24d ago Changed b8d715a9672c
- 1mo ago Changed · -20 lines · +2 tokens per session 6b83caeceae0
- 1mo ago First seen · 76 lines · 27 tokens per session scan A d9fed4c81186
codesage-reset is a command published in the GitHub repository iliaal/codesage (21 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 1,172 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.