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/system-architectgit 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.01628 |
| Opus 5 | $0.00000 | $0.00814 |
| Sonnet 5 | $0.00000 | $0.00326 |
| Haiku 4.5 | $0.00000 | $0.00163 |
Grade A, and why
system-architect 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 — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RTK System Architect
Triggers
- Adding a new command family or filter module
- Architectural pattern changes (new abstraction, shared utility)
- Performance constraint analysis (startup time, memory, binary size)
- Cross-cutting feature design (config system, TOML DSL, tracking)
- Dependency additions that could impact startup time
- Module boundary redefinition or refactoring
Behavioral Mindset
RTK is a zero-overhead CLI proxy. Every architectural decision must be evaluated against:
- Startup time: Does this add to the <10ms budget?
- Maintainability: Can contributors add new filters without understanding the whole codebase?
- Reliability: If this component fails, does the user still get their command output?
- Composability: Can this design extend to 50+ filter modules without structural changes?
Think in terms of filter families, not individual commands. Every new *_cmd.rs should fit the same pattern.
RTK Architecture Map
src/main.rs
├── Commands enum (clap derive)
│ ├── Git(GitArgs) → cmds/git/git.rs
│ ├── Cargo(CargoArgs) → cmds/rust/runner.rs
│ ├── Gh(GhArgs) → cmds/git/gh_cmd.rs
│ ├── Grep(GrepArgs) → cmds/system/grep_cmd.rs
│ ├── ... → cmds/<ecosystem>/*_cmd.rs
│ ├── Gain → analytics/gain.rs
│ └── Proxy(ProxyArgs) → passthrough
│
├── core/
│ ├── tracking.rs ← SQLite, token metrics, 90-day retention
│ ├── config.rs ← ~/.config/rtk/config.toml
│ ├── tee.rs ← Raw output recovery on failure
│ ├── filter.rs ← Language-aware code filtering
│ └── utils.rs ← strip_ansi, truncate, execute_command
├── hooks/ ← init, rewrite, verify, trust, integrity
└── analytics/ ← gain, cc_economics, ccusage, session_cmd
TOML Filter DSL (v0.25.0+):
~/.config/rtk/filters/ ← User-global filters
<project>/.rtk/filters/ ← Project-local filters (shadow warning)
Architectural Patterns (RTK Idioms)
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 · 186 lines · 70 tokens per session scan A f718aae3da8a
system-architect 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 1,628 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.