rtk is a command-line proxy that filters and compresses output from development commands before it reaches an LLM's context. It is used with coding agents to reduce the tokens consumed by commands such as Git operations. The catalogue includes skills, commands, agents, and instructions for using rtk in agent workflows.
Borrowing it
Nothing to install: this file belongs to rtk-ai/rtk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/rtk-ai/rtk/develop/.claude/agents/code-reviewer.mdgit clone --depth 1 https://github.com/rtk-ai/rtkWrote 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/agents/rtk-ai/rtk/code-reviewer)<a href="https://agentmods.dev/agents/rtk-ai/rtk/code-reviewer"><img src="https://agentmods.dev/badge/agents/rtk-ai/rtk/code-reviewer/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/agents/rtk-ai/rtk/code-reviewer"><img src="https://agentmods.dev/badge/agents/rtk-ai/rtk/code-reviewer.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.00000 | $0.02603 |
| Opus 5.5 | $0.00000 | $0.01041 |
| Sonnet 5.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 13d 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 ≥20% 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.
- 13d ago Changed · -426 tokens per session ababb0668d7e
- 1mo 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 (84,655 stars, last pushed yesterday), 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
atomic-reviewer
Diff / branch / file reviewer with two modes. Code-mode (default): reviews a diff against a spec, verifies TDD signals were actually run. Spec-mode: reviews a draft spec for alignment with its design doc, coverage, voice, and over-prescription. One line per finding, severity-tagged, no praise, no scope creep. Output…
atomic-auditor
Final gate for a finished implementation. Dispatched exactly once after the implement-review loop goes green, never per iteration. Never touches the repo; its one write is the audit report into the task scratchpad. Audits the delivered work as a whole: cumulative spec compliance, cross-iteration coherence…
atomic-deslopper
Read-only auditor for one shard of a standing codebase — a wiki domain or a directory, not a diff. Sweeps the files it is given for accumulated slop: comment noise, AI-tell doc prose, speculative abstraction, hand-rolled stdlib, duplicate helpers, dead code, errors used as control flow, and drift from the repo's own…
evidence-reviewer
Use after local checks to review whether Proofpack release claims match retained evidence.
code-reviewer
Senior code reviewer — reads diffs and surfaces bugs, security issues, and maintainability problems without modifying files.
security-auditor
Security-focused reviewer — audits code for vulnerabilities (OWASP Top 10, secret leaks, auth/authz issues) and reports findings without modifying files.