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/iliaal/codesage/codesage-evalgit clone --depth 1 https://github.com/iliaal/codesageWhat 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.00024 | $0.00985 |
| Opus 5 | $0.00012 | $0.00492 |
| Sonnet 5 | $0.00005 | $0.00197 |
| Haiku 4.5 | $0.00002 | $0.00098 |
Grade A, and why
codesage-eval 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 3d 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 — 64 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Evaluate CodeSage effectiveness on a specific project
Wraps ${CLAUDE_PLUGIN_ROOT}/bin/codesage-eval. Post-deployment effectiveness check: mine real user queries from this project's Claude Code session history, run them through CodeSage, and report how well retrieval actually performs on queries the user has asked on this codebase.
Use this AFTER /codesage-onboard and after the project has accumulated enough Claude Code session history (rule of thumb: at least a dozen sessions with real queries). On a freshly onboarded project with no session history, this command will fail with a clear error.
This is separate from /codesage-bench, which runs a regression suite across all corpora under $CODESAGE_BENCH_CORPUS_DIR (default: ./bench-corpora). /codesage-eval builds a fresh project-specific corpus every run (unless --no-extract is passed).
Step 1: Validate arguments
$ARGUMENTS — first positional arg is the project path. It must be a directory that exists AND has a corresponding ~/.claude/projects/<slug>/ directory with session transcripts. If either is missing, stop and explain why to the user.
Step 2: Run the eval
${CLAUDE_PLUGIN_ROOT}/bin/codesage-eval $ARGUMENTS
The script does two things:
- Mines up to
--max-cases(default 50) session-based eval cases from the project's Claude Code history. Writes them to<corpus-dir>/<project-name>-session-eval.yaml, overwriting any previous extract unless--no-extractis passed. - Runs
codesage-bench-runneragainst the fresh corpus and saves a timestamped scorecard under<corpus-dir>/history/.
Total runtime: usually 30-90 seconds for a small corpus on GPU. Background if it runs over 2 minutes.
Step 3: Report the metrics
Surface the summary the script prints:
- Cases mined
- Miss rate (% of queries where no ground-truth file landed in top-10)
- Median first-hit rank
- Mean recall@5 and recall@10
Reference baselines from prior runs of this corpus (stored under the history/ subdirectory of $CODESAGE_BENCH_CORPUS_DIR). A reasonable healthy target across application codebases is miss rate ≤ 15% and recall@10 ≥ 0.55. If the fresh numbers regress noticeably vs a prior run on the same corpus, flag that clearly.
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.
- 3d ago First seen · 64 lines · 24 tokens per session scan A 6fe8697d02fa
codesage-eval is a command published in the GitHub repository iliaal/codesage (20 stars, last pushed 3d ago), licensed MIT. It adds 24 tokens to every session and 985 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.
Other commands, from other repositories
rb-setup
First-time setup. Configure the LLM API key, or a no-API-key local host runner (Codex / Trae / Claude / any headless CLI) that RepoBrain uses for codebase Q&A and refresh. / 首次 setup,配置 RepoBrain 代码问答与 refresh 所需的 LLM API key,或无需 API key 的本地 host runner(Codex / Trae / Claude / 任意无头 CLI)。.
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 项目知识库。.
rb-init
Scaffold a new multi-agent repository from the RepoBrain template (invokes agent-repo-init skill). / 基于 RepoBrain 模板创建新的多智能体仓库。.
rp-build-cli
Build with rp-cli context builder → chat → implement.
rp-investigate-cli
Deep codebase investigation and architecture research with rp-cli commands.