rtk: Agent for Claude Code

.claude/agents/code-reviewer.md

code-reviewer is an agent for Claude Code from rtk-ai/rtk. It costs 0 tokens per session (2,603 once invoked), scanned A, original, Apache-2.0.

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

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions Claude Code.

This is rtk-ai/rtk's own configuration. It tells Claude Code how to work on rtk itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rtk configures →

About the project

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.

rtk-ai/rtk · 84,655 stars · on GitHub · rtk-ai.app

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/rtk-ai/rtk/develop/.claude/agents/code-reviewer.md
Clone the repo
git clone --depth 1 https://github.com/rtk-ai/rtk

Made for: Claude Code.

Wrote 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.

agentmods badge for code-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/rtk-ai/rtk/code-reviewer/github.svg)](https://agentmods.dev/agents/rtk-ai/rtk/code-reviewer)
Your own site
<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.

agentmods 80×15 button for code-reviewer

Your own site · 80×15
<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>
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. A grade says what 26 rules found in the file — not that it is safe.
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.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

Measured 13d ago against content hash ababb0668d7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

.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 ≥20% 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. 13d ago Changed · -426 tokens per session ababb0668d7e
  2. 1mo 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 (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.

Related

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…

damusix/atomic-claude · 194 tokens

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…

damusix/atomic-claude · 169 tokens

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…

damusix/atomic-claude · 154 tokens

evidence-reviewer

Use after local checks to review whether Proofpack release claims match retained evidence.

FlorianBruniaux/claude-code-ultimate-guide · 20 tokens

code-reviewer

Senior code reviewer — reads diffs and surfaces bugs, security issues, and maintainability problems without modifying files.

wesammustafa/opencode-primer · 22 tokens

security-auditor

Security-focused reviewer — audits code for vulnerabilities (OWASP Top 10, secret leaks, auth/authz issues) and reports findings without modifying files.

wesammustafa/opencode-primer · 30 tokens