code-reviewer

A Rust-focused code-review agent for checking code quality, security, speed, and command-line tool behaviour. Rust is a programming language, and a command-line tool is software operated through a terminal.

In plain words
What is it for?
Use it after substantial implementation work or before a commit or pull request to review changed modules and their effects on the RTK command-line tool.
Why use it?
It catches defects and regressions before code is committed or submitted for review, including problems with fallback behaviour, exit codes, startup time, and output reduction.

Agent for Claude Code

Install

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.

agentmods
npx agentmods add agents/rtk-ai/rtk/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/rtk-ai/rtk

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,603 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 2d ago against content hash efcb2ac46b29, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

.claude/agents/code-reviewer.md · 244 lines

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

  1. Context: Identify which module changed, what command it affects, token savings claim
  2. Call-site analysis: Trace ALL callers of modified functions, list every input variant, verify each has a test
  3. Static patterns: Check for RTK anti-patterns (unwrap, non-lazy regex, async)
  4. Token savings: Verify savings claim is tested with real fixture
  5. Cross-platform: Shell escaping, path separators, ANSI codes
  6. 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

Read the full file on GitHub · 244 lines

Changes

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.

  1. 2d ago First seen · 244 lines · 426 tokens per session scan A efcb2ac46b29

Subscribe to this mod's changes

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.