Skip to content
オープンソース · MIT · Rust 50.3k stars

AI エージェントは
CLI ノイズに埋もれている。 解決しよう。

rtk はコマンド出力がコンテキストウィンドウに入る前に圧縮します。 より良い推論。より長いセッション。より低いコスト。

89% 平均ノイズ除去
3x セッション延長
30+ コマンド数
Why RTK? The numbers.

89% noise reduction measured across 2,900+ real-world dev commands: cargo test 91.8%, git status 80.8%, find 78.3%, grep 49.5%. Free, open source (MIT, Rust).

Viking warrior smashing token noise with his axe
Terminal
$ rtk gain

📊 RTK Token Savings
════════════════════════════════════════

Total commands:    2,927
Input tokens:      11.6M
Output tokens:     1.4M
Tokens saved:      10.3M (89.2%)

By Command:
────────────────────────────────────────
Command               Count      Saved     Avg%
rtk find                324       6.8M    78.3%
rtk git status          215       1.4M    80.8%
rtk grep                227     786.7K    49.5%
rtk cargo test           16      50.1K    91.8%

$
Works with
  • Claude Code
  • Cursor
  • Aider
  • Gemini CLI
  • OpenAI Codex
  • Cline
  • Windsurf
  • GitHub Copilot
// 01 — 問題
Viking bracing against a tidal wave of tokens

今日の AI コーディングの問題

エージェントが実行するすべてのコマンドがノイズでコンテキストを汚染します。

コンテキスト汚染

200K コンテキストウィンドウは無限ではありません。cargo test が 5,000 トークンのボイラープレートを出力すると、5,000 トークン分の推論能力が失われます。

context_quality: degraded ▼

セッションが短すぎる

コンテキストがオーバーフローし、エージェントが再起動し、流れを失います。定額プランでは、本来より 40% 速く制限に達します。

session_remaining: 32% ▼

コスト爆発

トークン課金(API、Gemini CLI、Aider)では、請求の 70% は LLM が不要なノイズです。10 人チームで月約 $1,750 の無駄。

token_waste: $1,750/mo ▲
Viking compressing tokens into a glowing crystal

違いを見る

実際の出力、実際の節約。実コマンドの並列比較。

cargo test ~4,823 tokens
warning: unused variable: `start`
   --> src/init.rs:561:17
    |
561 |             let start = i;
    |                 ^^^^^ help: prefix it with an underscore

warning: `rtk` (bin "rtk" test) generated 17 warnings
    Finished `test` profile target(s) in 0.20s
     Running unittests src/main.rs

running 262 tests
test cargo_cmd::tests::test_filter_cargo_build_success ... ok
test cargo_cmd::tests::test_filter_cargo_clippy_clean ... ok
test cargo_cmd::tests::test_filter_cargo_test_all_pass ... ok
test cargo_cmd::tests::test_filter_cargo_test_failures ... ok
test cc_economics::tests::test_compute_dual_metrics ... ok
test git::tests::test_compact_diff ... ok
test git::tests::test_filter_branch_output ... ok
test git::tests::test_filter_log_output ... ok
test git::tests::test_filter_status_with_args ... ok
... 253 more tests, all passing

test result: ok. 262 passed; 0 failed; 0 ignored; 0 measured
rtk cargo test ~11 tokens -99%
✓ cargo test: 262 passed (1 suite, 0.08s)
pytest -v ~756 tokens
===== test session starts ======
platform darwin -- Python 3.14.3, pytest-9.0.2
collected 33 items

test_utils.py::TestStringUtils::test_strip PASSED    [  3%]
test_utils.py::TestStringUtils::test_upper PASSED    [  6%]
test_utils.py::TestStringUtils::test_split PASSED    [  9%]
test_utils.py::TestMathUtils::test_sqrt PASSED       [ 27%]
test_utils.py::TestMathUtils::test_ceil PASSED       [ 30%]
test_utils.py::TestJsonUtils::test_dumps PASSED      [ 51%]
test_utils.py::TestJsonUtils::test_loads PASSED      [ 54%]
test_utils.py::TestPathUtils::test_join PASSED       [ 63%]
test_utils.py::TestListOps::test_sort PASSED         [ 78%]
test_utils.py::TestListOps::test_flatten PASSED      [100%]
... 23 more tests, all passing

====== 33 passed in 0.05s ======
rtk test "pytest -v" ~24 tokens -96%
33 passed in 0.02s
go test ./... -v ~592 tokens
=== RUN   TestControllers
Running Suite: Controller Suite
Random Seed: 1771093287
Will run 1 of 1 specs
•
Ran 1 of 1 Specs in 6.037 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending
--- PASS: TestControllers (6.04s)
PASS
ok  kubecraft.ai/.../controller  6.610s
=== RUN   TestNewAWSBedrockClient
--- PASS: TestNewAWSBedrockClient (0.00s)
=== RUN   TestNewAzureOpenAIClient
--- PASS: TestNewAzureOpenAIClient (0.00s)
--- PASS: TestAzureOpenAIGenerateCode_Success (0.00s)
--- PASS: TestNewMistralClient (0.00s)
--- PASS: TestGenerateCode_Success (0.00s)
PASS
ok  kubecraft.ai/.../llm  0.776s
rtk test "go test ./... -v" ~246 tokens -58%
--- PASS: TestControllers (5.07s)
ok  kubecraft.ai/.../controller  5.847s
--- PASS: TestNewAWSBedrockClient (0.00s)
--- PASS: TestNewAzureOpenAIClient (0.00s)
--- PASS: TestAzureOpenAIGenerateCode_Success (0.00s)
--- PASS: TestNewMistralClient (0.00s)
--- PASS: TestGenerateCode_Success (0.00s)
ok  kubecraft.ai/.../llm  0.246s
git diff HEAD~1 ~21,500 tokens
diff --git a/index.html b/index.html
index 1b7488b..0ebac4f 100644
--- a/index.html
+++ b/index.html
@@ -629,7 +629,7 @@
       width: 100%;
       border-collapse: collapse;
       font-size: 0.88rem;
-      min-width: 800px;
+      min-width: 1050px;
     }
@@ -1051,6 +1051,114 @@
+    /* === Share My Gain === */
+    .share-gain { background: var(--bg); }
+    .share-gain-card {
+      max-width: 600px;
+      margin: 0 auto;
... 855 insertions(+), 266 deletions(-)
rtk git diff HEAD~1 ~1,259 tokens -94%
index.html | 1121 ++++++++++++------
 1 file changed, 855 ins(+), 266 del(-)

--- Changes ---

index.html
  @@ -629,7 +629,7 @@
  -      min-width: 800px;
  +      min-width: 1050px;
  @@ -1051,6 +1051,114 @@
  +    /* === Share My Gain === */
  +    .share-gain { background: var(--bg); }
  ... (truncated)
git status ~120 tokens
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   index.html
	modified:   src/main.rs
	modified:   src/config.rs

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	.fastembed_cache/
	tests/

no changes added to commit
rtk git status ~30 tokens -75%
* master...origin/master
~ 3  index.html, src/main.rs, src/config.rs
? 2  .fastembed_cache/, tests/
git log --stat -10 ~1,430 tokens
commit c84fa3c fix: add website URL (rtk-ai.app)
Author: patrick szymkowiak <52030887+pszymkowiak@...>
Date:   Thu Feb 12 12:28:37 2026 +0100

    - Cargo.toml: add homepage field
    - README.md: add website/github/install links

 .github/workflows/release.yml | 4 ++--
 Cargo.toml                    | 1 +
 Formula/rtk.rb                | 2 +-
 README.md                     | 8 ++++++++
 5 files changed, 14 insertions(+), 3 deletions(-)

commit a0d2184 feat(ci): automate Homebrew formula
... 8 more commits with full stats
rtk git log -n 10 ~194 tokens -86%
c84fa3c fix: add website URL (rtk-ai.app) (#81)
a0d2184 feat(ci): automate Homebrew formula (#80)
55d010a fix: update stale repo URLs (#78)
9e764c4 chore(master): release 0.13.1
bd76b36 fix(ci): fix release workflow artifacts
0d388b3 chore(master): release 0.13.0
93364b5 feat(sqlite): custom db location
3dde699 chore(master): release 0.12.0
645a773 feat(cargo): cargo install filtering
22182e4 chore(master): release 0.11.0
cat src/main.rs ~10,176 tokens
mod cargo_cmd;
mod cc_economics;
mod ccusage;
mod config;
mod container;
mod curl_cmd;
mod deps;
mod diff_cmd;
mod discover;
mod filter;
mod find_cmd;
mod gain;
mod gh_cmd;
mod git;
mod grep_cmd;
mod init;
mod json_cmd;
mod ls;
mod main.rs
... 1,295 lines total (enums, match arms, CLI parsing)
rtk read src/main.rs -l aggressive ~504 tokens -95%
use anyhow::{Context, Result};
use clap::{Parser, Subcommand};
struct Cli {
    // ... implementation
enum Commands {
    // ... implementation
enum GitCommands {
    // ... implementation
enum CargoCommands {
    // ... implementation
fn main() -> Result<()> {
    // ... implementation
grep -rn "pub fn" src/ ~2,108 tokens
src/cargo_cmd.rs:17:pub fn run(cmd: CargoCommand, ...) -> Result<()>
src/cargo_cmd.rs:551:pub fn run_passthrough(args: ...) -> Result<()>
src/cc_economics.rs:184:pub fn run(...)
src/config.rs:73:    pub fn load() -> Result<Self>
src/config.rs:85:    pub fn save(&self) -> Result<()>
src/config.rs:97:    pub fn create_default() -> Result<PathBuf>
src/filter.rs:57:    pub fn from_extension(ext: &str) -> Self
src/filter.rs:309:pub fn get_filter(level: FilterLevel) -> Box<dyn FilterStrategy>
... 112 matches across 47 files
rtk grep "pub fn" src/ ~940 tokens -55%
112 in 47 files:

src/cargo_cmd.rs (3):
    17: pub fn run(cmd: CargoCommand, ...) -> Result<()>
   551: pub fn run_passthrough(args: ...) -> Result<()>

src/config.rs (4):
    73: pub fn load() -> Result<Self>
    85: pub fn save(&self) -> Result<()>
    97: pub fn create_default() -> Result<PathBuf>
   109: pub fn show_config() -> Result<()>

src/git.rs (2):
    22: pub fn run(cmd: GitCommand, ...) -> Result<()>
  1264: pub fn run_passthrough(args: ...) -> Result<()>
... +62
find . -name "*.rs" ~276 tokens
./target/debug/build/serde_core-.../out/private.rs
./target/debug/build/libsqlite3-sys-.../out/bindgen.rs
./src/ls.rs
./src/local_llm.rs
./src/learn/detector.rs
./src/learn/report.rs
./src/discover/registry.rs
./src/discover/provider.rs
./src/cargo_cmd.rs
./src/ccusage.rs
./src/config.rs
./src/find_cmd.rs
./src/gain.rs
./src/git.rs
... 49 files total
rtk find "*.rs" . ~149 tokens -46%
49 files in 4 dirs:

src/ cargo_cmd.rs cc_economics.rs
  ccusage.rs config.rs container.rs
  curl_cmd.rs deps.rs diff_cmd.rs
  filter.rs find_cmd.rs gain.rs
  gh_cmd.rs git.rs grep_cmd.rs
  init.rs json_cmd.rs ls.rs
  main.rs ...
src/discover/ mod.rs provider.rs
  registry.rs report.rs
src/learn/ detector.rs mod.rs report.rs
src/parser/ error.rs formatter.rs
ls -la src/ ~3,200 tokens
total 928
drwxr-xr-x  41 patrick  staff   1312 .
drwxr-xr-x  25 patrick  staff    800 ..
-rw-r--r--   1 patrick  staff  16394 cargo_cmd.rs
-rw-r--r--   1 patrick  staff  27220 cc_economics.rs
-rw-r--r--   1 patrick  staff   9503 ccusage.rs
-rw-r--r--   1 patrick  staff   2884 config.rs
-rw-r--r--   1 patrick  staff  12886 container.rs
-rw-r--r--   1 patrick  staff   3406 curl_cmd.rs
-rw-r--r--   1 patrick  staff  12156 filter.rs
-rw-r--r--   1 patrick  staff  10648 gain.rs
... 20 more lines
rtk ls src/ ~640 tokens -80%
discover/
parser/
cargo_cmd.rs  16.0K
cc_economics.rs  26.6K
ccusage.rs  9.3K
config.rs  2.8K
container.rs  12.6K
filter.rs  11.9K
find_cmd.rs  2.9K
gain.rs  10.4K
...

37 files, 2 dirs (37 .rs)
cat Cargo.toml ~368 tokens
[package]
name = "rtk"
version = "0.13.1"
edition = "2021"
license = "MIT"
homepage = "https://www.rtk-ai.app"
repository = "https://github.com/rtk-ai/rtk"

[dependencies]
clap = { version = "4", features = ["derive"] }
anyhow = "1.0"
ignore = "0.4"
walkdir = "2"
regex = "1"
lazy_static = "1.4"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1" }
colored = "2"
dirs = "5"
rusqlite = { version = "0.31", features = ["bundled"] }
... + cargo-deb, cargo-generate-rpm metadata
rtk deps ~55 tokens -85%
Rust (Cargo.toml):
  Dependencies (15):
    clap (4)
    anyhow (1.0)
    ignore (0.4)
    walkdir (2)
    regex (1)
    lazy_static (1.4)
    serde (1)
    serde_json (1)
    colored (2)
    dirs (5)
    ... +5 more
Viking king on throne with 88.9% holographic display

実際の節約

満足した開発者の rtk gain による実際のフィードバック。

開発者のフィードバック

数週間の日常使用後:15,720 コマンド、1.38億トークン節約。rtk gain で確認。

88.9% efficiency
rtk gain dashboard showing 88.9% efficiency

詳細な内訳

コマンド別の日次・週次・月次統計。節約を追跡。

Per-command analytics
rtk gain daily and weekly breakdown
Viking squad marching through datacenter corridor

無制限の AI ツールはありません。すべてのトークンが重要。

月 $200 でも、すべてのツールに上限があります。RTK は CLI ノイズを圧縮し、制限を延長します。

典型的な 2 時間の AI コーディングセッション:

~60 CLI コマンド実行数
~210K CLI ノイズトークン
~23K RTK 使用時(89% 削減)

RTK なしでは、CLI 出力だけで 200K コンテキストがオーバーフローする可能性。

Claude Code Terminal
価格$20 — $200/mo
制限約 45 件/5時間(Pro)、Max 5-20倍
コンテキスト200K tokens
セッション約 3 倍延長
Max $200/月でも週次上限あり。RTK は CLI 出力を平均 89% 圧縮、制限を約 3 倍延長。
Cursor IDE
価格$20 — $200/mo
制限$20 クレジット/月(Pro)、約 225 Claude リクエスト
コンテキスト最大 200K(Maxモード)
クレジット約 2 倍持続
Ultra $200/月でも上限あり。RTK が CLI 出力を圧縮し、リクエストをクリーンに。
OpenAI Codex Agent
価格$20/月(Plus)— $200/月(Pro)
制限5時間あたり 30-1,500 件
コンテキスト192K tokens
上限あたりより多くの反復
ChatGPT プランに含まれる。Pro $200/月は 5時間 1,500 件上限。RTK が出力を圧縮し、より多くの反復を実現。
Windsurf IDE
価格$15 — $60/mo
制限500 クレジット/月(Pro)
コンテキスト200K tokens
クレジット約 2 倍持続
Enterprise $60/ユーザーで 1,000 クレジット/月。RTK が CLI 出力を圧縮し、クレジットを延長。
Gemini CLI Terminal
価格無料 — トークン課金
制限日 1,000 リクエスト、分 60(無料)
コンテキスト1M tokens
トークン請求約 70% 削減
無料枚は寛大(日 1,000)だがレート制限あり。RTK が 89% 圧縮し、請求削減または制限緩和。
Aider Terminal
価格無料 + API費用($5-300+/月)
制限API プロバイダー次第
コンテキストモデル次第(最大 200K)
APIコスト約 70% 削減
自前 API キー—トークン課金。RTK が全出力を圧縮、API費用を約 70% 削減。
GitHub Copilot IDE
価格無料 — $39/月(Pro+)
制限月 50-1,500 プレミアムリクエスト
コンテキストモデル次第(最大 200K)
コンテキスト品質向上
Enterprise $39/ユーザー:月 1,000 プレミアム。RTK がターミナル出力を精縮に保ち、リクエストのコンテキスト品質向上。
Cline / Roo VS Code
価格無料 + API費用($0-500+/月)
制限API プロバイダー次第
コンテキストモデル次第(最大 200K)
APIコスト約 70% 削減
ツール側制限なし。RTK が 89% 圧縮、請求とオーバーフローを直接削減。

2026年2月時点の価格。RTK 節約は 2,900+ コマンドの平均 89% 圧縮率に基づく。

近日公開

RTK Cloud

チームの AI コーディングコストの可視化と制御。無駄を把握。解決。

トークン分析

開発者・プロジェクト・ツール別ダッシュボード

チーム節約レポート

「チームは今月 $4,200 節約」

レート制限アラート

モニタリングとスマート通知

エンタープライズ制御

SSO、監査ログ、コンプライアンス

オープンソースは無料。チームは $15/開発者/月 から。

0 チームが待機中

スパムなし。ローンチ時に 1 通。

Viking slamming axe into ground creating green energy shockwave
// はじめる

30秒で開始

インストール、自動書き換えフックを有効化、すべてのコマンドが自動圧縮。

クイックインストール

Linux・macOS ワンライナー

curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh

Via Homebrew

macOS & Linux

brew install rtk
brew upgrade rtk

ビルド済みバイナリ

macOS、Linux、Windows

次に自動書き換えフックを有効化

rtk init --claude-code

Claude Code settings.json に PreToolUse フックをインストール—すべての Bash 呼び出しが自動的に書き換えられます。 完全インストールガイド →

1 curl ... | sh
2 rtk init --claude-code
3 rtk gain
Viking raising axe in triumphant war cry
// ship it

AI はこれを全部
読む必要はない。

rtk をインストール。より良いコード、より長いセッション、より低いコスト。

Frequently asked questions

What is RTK (Rust Token Killer)?

RTK is an open-source CLI tool that compresses command outputs before they reach the AI context window. It reduces token usage by 60-90% with zero configuration changes, enabling longer AI coding sessions and lower API costs. RTK is written in Rust, MIT licensed, and works transparently with Claude Code, Cursor, and any terminal-based AI assistant.

How many tokens does RTK actually save?

Based on measurements across 2,900+ real-world commands, RTK removes an average of 89% of CLI output noise. Command-level savings: cargo test (91.8% savings), git status (80.8%), find (78.3%), grep (49.5%). A developer who ran 15,720 commands saved 138 million tokens over several weeks, tracked live via rtk gain.

Is RTK free? Are there usage limits?

RTK is completely free. It is open source under the MIT license, with source code available on GitHub at github.com/rtk-ai/rtk. There are no usage limits, no API keys required, no telemetry, and no accounts. RTK Cloud (waitlist) will offer additional team features.

Which AI coding tools and commands does RTK support?

RTK works with Claude Code (Anthropic), Cursor, Gemini CLI, Aider, and any AI assistant that reads terminal output. It supports all major CLI commands: cargo test, pytest, go test, git diff, git status, git log, grep, find, ls, pnpm list, tsc, eslint, prisma, docker, kubectl, and more.

How does RTK work without changing my workflow?

Running rtk init --global installs a PreToolUse hook in Claude Code that automatically rewrites Bash commands to rtk equivalents at the proxy layer. You continue using your normal commands. RTK intercepts and compresses the output before it enters the context window, with no manual changes to prompts or workflows needed.

Does RTK affect code quality or AI reasoning accuracy?

No. RTK removes verbose boilerplate and repetitive output noise, not meaningful content. Test failures, error messages, diffs, and stack traces are preserved in full. The AI receives the same essential information with 89% less noise, which typically improves reasoning quality by reducing context pollution.