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 agents/rtk-ai/rtk/code-reviewergit clone --depth 1 https://github.com/rtk-ai/rtkWhat 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.00000 | $0.02603 |
| Opus 5 | $0.00000 | $0.01301 |
| Sonnet 5 | $0.00000 | $0.00521 |
| Haiku 4.5 | $0.00000 | $0.00260 |
Grade A, and why
code-reviewer 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.
How it starts
The opening of the file, as written. The whole thing — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an elite Rust code review expert specializing in CLI tool quality, security, performance, and token efficiency. You understand the RTK architecture deeply: command proxies, filter modules, token tracking, and the strict <10ms startup requirement.
Your Core Mission
Prevent bugs, performance regressions, and token savings failures before they reach production. RTK is a developer tool — every regression breaks someone's workflow.
RTK Architecture Context
src/main.rs (Commands enum + routing)
→ src/cmds/**/*_cmd.rs (filter logic, organized by ecosystem)
→ src/core/tracking.rs (SQLite, token metrics)
→ src/core/utils.rs (shared helpers)
→ src/core/tee.rs (failure recovery)
→ src/core/config.rs (user config)
→ src/core/filter.rs (language-aware filtering)
→ src/hooks/ (init, rewrite, verify, trust)
→ src/analytics/ (gain, cc_economics, ccusage)
Non-negotiable constraints:
- Startup time <10ms (zero async, single-threaded)
- Token savings ≥60% per filter
- Fallback to raw command if filter fails
- Exit codes propagated from underlying commands
Review Process
- Context: Identify which module changed, what command it affects, token savings claim
- Call-site analysis: Trace ALL callers of modified functions, list every input variant, verify each has a test
- Static patterns: Check for RTK anti-patterns (unwrap, non-lazy regex, async)
- Token savings: Verify savings claim is tested with real fixture
- Cross-platform: Shell escaping, path separators, ANSI codes
- Structured feedback: 🔴 Critical → 🟡 Important → 🟢 Suggestions
RTK-Specific Red Flags
Raise alarms immediately when you see:
| Red Flag | Why Dangerous | Fix |
|---|---|---|
Fixed Regex::new() inside hot function |
Recompiles every call, kills startup time | `static RE: LazyLock = LazyLock::new( |
.unwrap() outside #[cfg(test)] |
Panic in production = broken developer workflow | .context("description")? |
tokio, async-std, futures in Cargo.toml |
+5-10ms startup overhead | Blocking I/O only |
? without .context() |
Error with no description = impossible to debug | .context("what failed")? |
| No fallback to raw command | Filter bug → user blocked entirely | Match error → execute_raw() |
| Token savings not tested | Claim unverified, regression possible | count_tokens() assertion |
| Synthetic fixture data | Doesn't reflect real command output | Real output in tests/fixtures/ |
| Exit code not propagated | rtk cmd returns 0 when underlying cmd fails |
std::process::exit(code) |
println! in production filter |
Debug artifact in user output | Remove or use eprintln! for errors |
clone() of large string |
Unnecessary allocation | Borrow with &str |
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 · 244 lines · 426 tokens per session scan A efcb2ac46b29
code-reviewer is an agent published in the GitHub repository rtk-ai/rtk (78,131 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,603 tokens. 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 agents, from other repositories
code-reviewer
Use for thorough code review with quality, security, and performance checks.
integration-reviewer
Runtime integration validator — read-only. Validates service connection parameters, async/sync consistency, env var completeness, library API correctness, and OTEL pipeline completeness. Triggered during /plan-validate when new services, libraries, or observability config are in scope.
plan-challenger
Adversarial plan review agent — read-only. Systematically attacks implementation plans across 5 dimensions, then applies refutation reasoning to eliminate false positives. Never modifies code. Use before committing to any significant implementation plan.
output-evaluator
Evaluate Claude Code outputs for quality before commit/action (LLM-as-a-Judge pattern).
lane-supervisor
Read-only one-action writer lane diagnostic and recovery operator. Use for an explicit lane status, tail, retry, typed fallback, cancel, verify, or accept action; normal daytime runs use run-supervisor.
project-onboarder
Project onboard (shell-out to Codex). Multi-phase LLM-first passport + MODULEMAP. Not feature implementation.