JetBrains、コーディングエージェントの「rtk」スキルがトークン削減に寄与しないことを実証
本文の状態
日本語全文を表示中
詳細モードで約16分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
JetBrains AI Blog
JetBrains AI Blog は Claude Code のトークン削減ツール「rtk」を厳密にテストし、低負荷時ではむしろコストが増加する結果となり、広告された 60-90% の削減効果は実証されなかったことを明らかにした。
AI深層分析を開く2026年8月4日 17:16
AI深層分析
キーポイント
測定値と広告の乖離
rtk が広告する 60〜90% のトークン削減に対し、実際のベンチマークでは低推論負荷時に +7.6% のコスト増、高負荷時には±0% の結果となった。
ツールの限界と非対応領域
rtk は Bash 出力の圧縮に特化しており、Claude Code が内蔵ツールでファイル参照や検索を行う場合はフックが機能せず、削減効果が得られない。
品質と正しさへの懸念
テスト結果の要約を行うフィルタリングは編集的判断を伴うため、重要な行が欠落してエージェントが誤った判断を下すリスクがあり、トークン削減に質的な代償が生じる可能性がある。
厳密な検証環境での評価
JetBrains は Docker 沙箱と SkillsBench ベンチマークを用いて Claude Code 2.1.201 と claude-sonnet-5 を比較し、タスク品質は両者で変化しないことを確認した。
rtk が触れる可能性のあるトークンの上限は約3%
モデルがファイル読み取りに組み込みツールを使用したり、Bash以外のコマンドを実行したりするため、rtkフックが処理できるのはBash呼び出しの33%に過ぎない。
重要な引用
"rtk advertised saving: 60–90%. Measured on real agent work: +7.6% more expensive at low reasoning effort"
"Token savings that come with a quality tax are not savings."
"Whatever those tools carry, rtk can never touch."
Squeeze rtk's whole share by 70% and the cap works out to ≈3% of input tokens.
編集コメントを表示
編集コメント
ベンダーが提示する「トークン削減」の数値は、特定のシナリオや理想条件下でのみ成立する場合が多く、実運用では異なる結果を招くリスクがある。開発者はツールの導入前に、自社の具体的なワークフローに基づいた検証を行うことが、コストと品質のバランスを保つ上で重要である。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
「rtk」は Claude Code のトークン使用量を削減するのか?
このシリーズ第 2 弾では、コーディングエージェント向けの公開「トークン節約」アドオンを一つずつ取り上げ、それぞれに対して同じペア A/B ベンチマークを実行します。前回の第 1 報で検証したのが「caveman skill」(広告では−65% と謳われていたが、測定結果は−8.5%)でした。
要約:rtk が謳う削減効果は 60〜90% ですが、実際のエージェント作業での測定では、推論負荷が低い場合、コストが +7.6% 増(p=0.004)、高い場合は±0% の変化でした。検証環境は Claude Code 2.1.201 と claude-sonnet-5(低・高推論設定)、タスクセットは SkillsBench です。いずれの推論レベルでも、両グループでタスク品質に差はありませんでした。
なぜこの検証を行ったのか
「Rust Token Killer」と呼ばれる rtk は、CLI プロキシとしてシンプルな訴求点を持っています。エージェントが git status を実行すると、rtk がそれをインターセプトして実際のコマンドを実行し、モデルには出力を圧縮したバージョンを渡すのです。例えば、11 行にわたる詳細な出力の代わりに「* master / M a.txt / ?? b.txt」といった簡潔な形式で提供されます。Claude Code の PreToolUse フックが対象となるシェルコマンドを透明性高く書き換えるため、モデル側は rtk という存在を意識する必要すらありません。README にはトークン消費量が 60〜90% 削減できると明記され、30 分間のセッションで 118k トークンのコマンド出力が 24k に圧縮された事例も紹介されています。
この圧縮技術自体は実在しており、多くの場合、洗練されたものでもあります。以下に、テストコンテナからキャプチャした実際のリポジトリでの rtk の動作例を示します:
git status # rtk git status
On branch master * master
Changes not staged for commit: M a.txt
(use "git add ..." to update…) ?? b.txt
modified: a.txt
Untracked files:
(use "git add ..." to include…)
b.txt
no changes added to commit …
python -m pytest (19 lines) # rtk pytest
…full pytest output… Pytest: 2 passed, 1 failed
Failures:
- [FAIL] test_fail
test_demo.py:3: in test_fail
E AssertionError: one is not two
このアイデアの良さに惹かれて、実際に検証してみることにしました。README には明記されていない、2 つの重要な疑問があります。
まず、実際のエージェントセッションにおいて、Bash の出力がどれほど占めているのかという点です。削減効果を示す表は、エージェントがあらゆる処理をシェル経由で行うことを前提にしています。しかし、Claude Code はファイル読み込みに組み込みの Read ツールを使い、検索には Grep を利用します。これらは Bash フックを完全に迂回するため、rtk のドキュメントでも認められている通り、これらのツールが扱うデータに対して rtk が介入できる余地はありません。
次に、圧縮によって正しさが損なわれるリスクはないかという点です。テスト出力を要約するフィルタは、モデルにとって何が重要かを判断して編集を加える行為です。もし重要な 1 行を見落としてしまったらどうなるでしょうか?エージェントはコマンドを再実行したり、ファイルを生のまま読み込んだりします。最悪の場合、失敗しているビルドに対して勝利宣言を下してしまう恐れもあります。品質の低下という代償を払って得られるトークン削減は、もはや削減と呼べるものではありません。
セットアップ
HarnessHarbor 0.18 の Docker サンドボックス、タスク検証機能、ペア実行環境
AgentClaude Code 2.1.201 をヘッドレスモードで利用。権限バイパス機能を有効化し、両アームに固定。
モデルは claude-sonnet-5 を使用。低推論コストと高推論コストの 2 パターンでそれぞれ 2 回実行。
ベンチマークは SkillsBench。87 タスクのうち 86 タスクを自動採点(0〜1 のスコア、一部正解にもポイント付与)。
アーム A は標準の Claude Code を使用。
アーム B は rtk v0.43.0 をそのまま使用。rtk init -g で提供されるバイナリ、PreToolUse フック、RTK.md を一切変更せず。
実行ボリュームは 4 つのペア実行(10 タスクのスモークテスト、同じ 10 タスクを k=3 で再実行、低推論コストでの全 86 タスク、高推論コストでの全 86 タスク)。合計 425 回の課金済みトライアルで、費用は約 320 ドル(Harbor が記録した 317 ドルに、再構築されたサブエージェントの支出を加算)。
フックがすべての対象となる Bash コマンドを機械的に書き換えるため、アーム B は rtk の出荷時性能上限を測定するもの。モデルが「使い方を覚えているか」といった議論の余地は生じない。rtk を使用したすべてのトライアルでは、rtk 自身の監査ログと分析データベースも併せて保存され、処理が実際に実行されたことの証拠となる。
発見 1:エージェントのデータ量の多くはフックに到達しない
何かを支出する前に、既存の 83 のベースライントランスクリプト(同じモデル、同じベンチマーク)を再生し、「rtk がインストールされていれば、何に触れることができたか」を検討した。
構造上の理由が二つあります。第一に、Claude Code は内蔵の Read/Grep ツールを使ってファイルを読み込むため、Bash フックを完全に迂回します。rtk 自身の README も脚注でこれを認めています。
第二に、エージェントがシェルで実行するものの半分は python3 … その他の未対応コマンドであり、6 分の 1 は rtk が意図的に書き換えを拒む「ファイルへのパイプ」「heredoc」「置換」です。残りの Bash コール(全体の 33%)が担うのは、ツール結果の文字数の 20% に満たない部分だけです。さらに、ツール結果自体もセッションで請求される入力のごく一部に過ぎません。同じコンテキストが各ターンで再読されるからです。rtk の全シェアを 70% 削減しても、上限は入力トークンの約 3% にすぎません。この数字は計算コストゼロで算出でき、結果を正確に予測していました。
発見 2:トークン節約なし、ただしわずかながら有意なコスト増
我々は「 caveman eval」が教えた手順に従って評価を行いました。rtk の最良ケースとなる、意図的に Bash 負荷の高いタスク 10 件における k=1 の簡易テストでは、rtk アームの費用中央値は +35% 増となりました。これは驚くべき結果ですが、同じタスクを同じアームで繰り返し実行した場合でも、コストの中央値にはすでに 22% のばらつきがあることを知れば、その脅威は相対化されます。k=3 では恐怖の大半がノイズに溶け込み(Wilcoxon p≈0.65)、これは k=1 の幻覚として当然の結果です。
その後、86 のタスク全体でノイズ耐性のある回答が得られ、結果はゼロではありませんでした。80 のクリーンなペアを対象に比較すると、rtk を使用したアームの方が 1 タスクあたりのコストが中央値で +7.6% 高くなり(p=0.004)、これは途中で発見されたコスト計算の誤差を補正した後の結果です。また、ターン数は +13.8% 増加し(p=0.03)、キャッシュ読み込みも +14.3% 増えました(p=0.008)。一方、「新しい入力」は rtk が実際に圧縮する唯一のトークンクラスですが、その変化はわずか +3.2% に留まりました(p=0.23)。これは、上限分析において利益が生まれるはずだった場所に、明確なゼロ変化が生じたことを意味します。
フックが書き換えたコマンドの数が多いほど、ペナルティも大きくなりました。前述の補正済みコスト基準で比較すると、フックに多く暴露されたタスクペアはベースラインより約 24% コストが高くなる一方、フックがほとんど手をつけなかったペアでは 5% の増加にとどまりました。タスクの難易度で統制してもこのパターンは再現されず、Bash を多く使用するタスクが難しいからといって説明がつくわけではありません。トランスクリプトの詳細分析では、単一の悪玉は見つかりませんでした。実際に破綻した書き換え(複合検索述語が使用エラーに転化しリトライが発生するケース)や、圧縮による再読み込みが数件あるのみで、極端なペアにおける通常のばらつきが大半を占めています。劇的な失敗というよりは、薄く継続的なコスト増と言えます。
発見 3:高負荷時でもペナルティは消失する
「推論コストを低く設定しただけでは」という批判は当然でした。そこで、シリーズで最も高コストとなる単一実行として、86 件のタスクすべてを高い推論コスト(high effort)で再実行しました。その結果、コスト増の傾向は再現されませんでした。ペアごとの差分中央値は +0.1% (p=0.99)、ターン数は +0.0 (p=0.74) で、品質も依然として同点です。高い推論コストでは、モデルが圧縮された出力に対して反応する無駄なターンを減らしているように見えます。ただし k=1 の場合、単にコスト増の兆候が見られなかっただけであり、2 つの推論コスト設定で本質的な違いがあるとは断定できません。いずれにせよ、rtk が何らかの節約をもたらした瞬間はありませんでした。
発見 4:品質は維持される
rtk の課題トラッカーに報告されていた恐ろしい失敗事例——テスト出力の過度なフィルタリングや、エクスイトコードのマスク化、圧縮テキストをパイプ経由で受け渡すケースなど——はほとんど発生しませんでした。ターン数の差分が最も大きかった 6 ペアの煙出しテスト(smoke pairs)を精査した結果、壊れた再書き込みが 1 件(フル実行でも確認された同一の compound-find 失敗モード)、エージェントがフックを意図的に迂回したケースが 1 件見つかりました。これらは約 150 回の Bash コールの中でのものでした。これらのトランスクリプトでは、回復用ファイルは読み込まれておらず、圧縮パイプから誤ったカウント結果も出力されていません(フル実行では回復用ファイルの読み込みが 1 件確認されました)。追加されたターン数は圧倒的にモデルが異なる解決経路を選択したものであり、rtk の混乱によるものではありません。フル実行におけるタスクスコアは、低い推論コストで「5 点アップ・4 点ダウン・71 同点」、高い推論コストで「5 点アップ・4 点ダウン・62 同点」でした(両方の条件で符号検定 p=1.0)。これは、部分採点を考慮しても両者の品質には統計的な差がないことを示しています。
正直に付け加えるなら、ある一つのタスク(ダイアログパーサー)では、rtk 自体のバイナリがタスク用のイメージ内で起動できませんでした。これはより新しい glibc が必要だったためです。その結果、rtk を使用した試行は両方のフルランでセットアップ段階で失敗し、一方、通常の ARM アームではスコア 0.667 を記録しました。ペア分析ではこのタスクを両方のグループから除外していますが、これは Docker のノイズではなく、実際の互換性の欠陥です。エラーが発生した試行をすべてゼロ点として計算しても、両者のスコアは依然として同程度です(符号検定 p=1.0)。
発見 5:rtk 独自のスコアボードと請求額の比較
これはギャップの正体を説明する発見です。低負荷のフルラン全体を通じて、rtk の組み込み分析(rtk gain)は 9,620 万トークンの削減を報告しました。これは rtk が触れたすべての処理の 99.8% に相当します。しかし、同じ試行における実際の請求額は増加していました。スコアボードが過大評価する要因として、以下の 3 つのメカニズムが考えられます。
第一に、rtk は反事実的な基準として完全な生出力をカウントしています。1.2 MB の CSV を 1 回処理しただけで「32 万トークン削減」と表示されましたが、Claude Code はツール結果を 32 万トークンに達する前に大幅に切り捨てます。つまり、エージェントはどちらの場合でも数千人分のトークンを取得していたはずです。このフルランでは、そのような巨大な読み込みが 190 回記録され、平均して各回約 50.6 万トークンの「削減」と算出されていました。
第二に、rtk は実行時に文字数を 4 で割ることでトークンを推定しますが、セッションの多くの入力コストはキャッシュされた再読み込みであり、請求単価はその 1/10 です。
第三に、フックが検知するのはコンテキストのごく一部に過ぎません。スコアボードは実質的に自分の宿題を採点している状態です。
結論
誠実なエンジニアリングでありながら、誤った対照実験に基づいた結論でした。私たちはこの手法に勝利を期待していましたが、デモ自体は実際に遊ぶのに満足できるものでした。フィルタは本物で、しばしば洗練されており、品質が損なわれることもありません。フック機構も設計通りに機能しています。
しかし、実際のエージェントによるコーディング作業において、宣伝されている 60–90% の削減効果はどこにも存在しませんでした。フックが見るのはツール出力の約 5 分の 1 に過ぎず、Claude Code は rtk が圧縮を自慢する病理的な出力をすでに切り捨てています。また、入力コストの大部分を占めるキャッシュされた再読み込みは、請求額では 10 分の 1 の価格で済みます。
残ったのは、低負荷時における測定された平均 +7.6% のコスト増と、高負荷時にはゼロの変化です。これは不具合のある書き換えによるわずかな税金や、追加の探索ターンによるものであり、決して節約にはなりません。
rtk に限らず、より深い教訓が得られます。ツールの自己申告による削減効果は、あなたの請求書に関する事実ではなく、あくまで「もしそのツールを使っていなかったら」という仮定の話に過ぎません。rtk のスコアボードは 9600 万トークンの節約を謳っていましたが、実際の請求額は増えています。文脈圧縮ツールの評価を行う際は、ツールの差分ではなく、ペアになった請求額を測定すべきです。
方法論に関する注記
パート 1 と同じ厳格な基準で実施し、高価な教訓から学びました:
- k=1 の結果を決して信用してはなりません。実行の順序は以下の通りでした:無料のトランスクリプト再生 → 1 試行による配線チェック → k=1 で Bash を多用したタスク 10 件 → 同じく k=3 で 10 件 → 最終的に低負荷・高負荷の両方で、86 件の全タスクを k=1 で 2 回実行。
- タスクごとのスコアは試行ごとに両方のグループで自由に変動しますが、報告されるのはこの順序を経て生き残ったペア差分のみです。
今回の分析はペア比較のみです。すべての数値は、同じジョブ下で異なるアーム間で同一タスクを比較したものです。いずれのアームでもエラーが発生したタスクは両方のデータセットから除外されます。
品質評価には非同率のケースに対する厳密な符号検定を使用し、トークン数やコストの変化については、各タスクごとの中央値とウィルコクソンの符号付順位和検定を採用しました。アーム全体の合計値は外れ値に支配されるためです。例えば、単一のセッションで 20 万トークンの長文コンテキスト価格帯を超えると、請求額が通常の 25 倍になるケースもあり、単純な総計では正確な比較ができません。
評価項目は事前に登録済みです。主目的は、コストと「新規入力」トークン数(キャッシュ未利用分+キャッシュ生成分;圧縮されたツール結果が実際に格納される箇所)におけるタスクごとのペア差分を測定することです。これらは有料実行前に決定され、採用度を層別化した分割方針とともに策定されました。
導入状況は仮定せず、計測しました。rtk を使用したすべての試行では、rtk のフック監査ログと history.db が保存されるため、各試行で書き換えが実際に発生し実行されたことを証明できます。これにより、「rtk は何も節約できなかった」という結果と、「rtk が全く実行されなかった」という結果を明確に区別することが可能です。
試行内容によりますが、フックは検出した Bash コマンドの 3 分の 1 から半分(33〜50%)を書き換えました。これは、各試行ごとの配線チェックを除外した後の数値です。また、モデル自体が rtk を使用したのは 86 回の試行中 6 回だけでした。
検証環境の概要:rtk は v0.43.0 のリリースバイナリ(sha256 で固定)、Claude Code は 2.1.201 を両アームで共通、モデルは claude-sonnet-5、Harbor は 0.18 です。SkillsBench では bike-rebalance タスクを除外しました。これは allow_internet=false の設定がローカル Docker ジョブでクラッシュするためです。rtk、Harbor、SkillsBench はいずれも Apache-2.0 ライセンスです。
シリーズの次回は、ツール名をお知らせいただければ、その評価を試みます。言葉は少なく、事実をテストします。
なお、本記事で採用しているドット模様のチャートスタイルは、grim 氏の「dither-kit」から敬意を込めて借用したものです。これは依存関係のないインラインウィジェットとしてゼロから再実装されたものです。
原文を表示
Does “rtk” reduce Claude Code token usage?
Part 2 of a series where we take public “token saving” add-ons for coding agents and run the same paired A/B benchmark against each of them. Part 1 was the caveman skill (advertised −65%, measured −8.5%).
TL;DR: rtk advertised saving: 60–90%. Measured on real agent work: +7.6% more expensive at low reasoning effort (p=0.004), ±0% at high effort. Setup: Claude Code 2.1.201 · claude-sonnet-5 low and high efforts · SkillsBench. Task quality: unchanged in both arms, at both effort levels.
Why we ran this
rtk (“Rust Token Killer”) is a CLI proxy with a simple, appealing pitch: your agent runs git status, rtk intercepts it, runs the real command, and hands the model a compressed version of the output — * master / M a.txt / ?? b.txt instead of eleven lines of porcelain. A Claude Code PreToolUse hook rewrites eligible shell commands transparently, so the model doesn’t even have to know rtk exists. The README promises 60–90% less token consumption and walks through a 30-minute session where 118k tokens of command output become 24k.
The compression itself is real and often tasteful. Here is rtk on a live repo, captured from our test container:
git status # rtk git status
On branch master * master
Changes not staged for commit: M a.txt
(use "git add <file>..." to update…) ?? b.txt
modified: a.txt
Untracked files:
(use "git add <file>..." to include…)
b.txt
no changes added to commit …
python -m pytest (19 lines) # rtk pytest
…full pytest output… Pytest: 2 passed, 1 failed
Failures:
- [FAIL] test_fail
test_demo.py:3: in test_fail
E AssertionError: one is not two
We liked the idea enough to test it properly. Two questions the README doesn’t answer:
First, how much of a real agent session is Bash output at all? The savings table assumes the agent shells out for everything. But Claude Code reads files with its built-in Read tool, searches with Grep, and both bypass the Bash hook completely (rtk’s docs acknowledge this). Whatever those tools carry, rtk can never touch.
Second, does compression cost correctness? A filter that summarizes test output is making an editorial judgment about what the model needs. If it drops the one line that mattered, the agent re-runs commands, reads files raw, or, worse, declares victory on a failing build. Token savings that come with a quality tax are not savings.
Setup
HarnessHarbor 0.18 – Docker sandboxes, task verifiers, paired runs
AgentClaude Code 2.1.201, headless, bypassPermissions, pinned in both arms
Modelclaude-sonnet-5 – full run twice: at low and at high reasoning effort
BenchmarkSkillsBench, 86 of 87 tasks, auto-graded 0–1 with partial credit
Arm Astock Claude Code
Arm Brtk v0.43.0 exactly as rtk init -g ships it: binary + PreToolUse hook + RTK.md
Volume4 paired runs (10-task smoke, same 10 at k=3, full 86 at low effort, full 86 at high effort) total of 425 billed trials, ≈USD 320 (Harbor-recorded USD 317 plus reconstructed subagent spend)
Because the hook rewrites every eligible Bash call mechanically, arm B measures rtk’s as-shipped ceiling: no “did the model remember to use it” gap to argue about. Every with-rtk trial also persists rtk’s own audit log and analytics database, as proof the treatment actually fired.
Finding 1: Most agent bytes never touch the hook
Before spending anything we replayed 83 existing baseline transcripts (same model, same benchmark) and asked: if rtk had been installed, what could it even have touched?
Two structural reasons. First, Claude Code reads files with its built-in Read/Grep tools, which bypass the Bash hook entirely; rtk’s own README admits this in a footnote. Second, half of what agents run in a shell is python3 … and other uncovered commands, and a sixth uses pipes-to-files, heredocs and substitutions that rtk deliberately refuses to rewrite. What’s left, 33% of Bash calls, carries just under 20% of tool-result chars; and tool results are themselves only a slice of what a session bills as input, because the same context is re-read on every turn. Squeeze rtk’s whole share by 70% and the cap works out to ≈3% of input tokens. This number cost nothing to compute, and it predicted the outcome.
Finding 2: No token savings; but a small, significant cost increase
We ran the ladder the caveman eval taught us to run. The k=1 smoke on ten deliberately Bash-heavy tasks (rtk’s best case) showed the rtk arm a median +35% more expensive. Alarming, until you know that identical attempts of the same task in the same arm differ by a median 22% in cost anyway. At k=3 most of the scare evaporated into noise (Wilcoxon p≈0.65), exactly as a k=1 mirage should.
Then the full 86 tasks gave the noise-resistant answer, and it wasn’t zero. Across 80 clean pairs the with-rtk arm came out a median +7.6% more expensive per task (p=0.004, after correcting a cost-accounting gap we found along the way), on +13.8% more turns (p=0.03) and +14.3% more cache reads (p=0.008). Meanwhile “new input”; the only token class rtk actually compresses, moved just +3.2% (p=0.23): a flat null precisely where the ceiling analysis said the entire benefit had to live.
The more commands the hook rewrote, the larger the penalty. On the same corrected cost basis as the headline result, heavily exposed task pairs cost about 24% more than baseline, versus 5% for pairs the hook barely touched. Controlling for task difficulty did not reproduce this pattern, so harder tasks using more Bash does not appear to explain it. Transcript forensics found no single villain: one genuinely broken rewrite (compound find predicates turned into usage errors and retries), a few compression-induced re-reads, and a lot of ordinary variance on the extreme pairs. A thin, systematic tax rather than a dramatic failure.
Finding 3: At high effort, even the penalty disappears
“You only tested at low reasoning effort” was the obvious critique, so we ran all 86 tasks again at high effort – the most expensive single run of the series. Result: the cost penalty does not replicate there. Median paired delta +0.1% (p=0.99), turns +0.0 (p=0.74), quality still tied. At high effort, the model seems to waste fewer turns reacting to compressed output; though at k=1 all we can say is that the penalty didn’t show up there, not that the two effort regimes probably differ. Either way, at no point did rtk save anything.
Finding 4: Quality survives
The scary failure modes from rtk’s issue tracker including over-filtered test output, masked exit codes, pipes fed compressed text, they barely materialized. A forensic pass over the six smoke pairs with the biggest turn deltas found exactly one broken rewrite (the same compound-find failure mode the full run hit) and one case of the agent deliberately bypassing the hook, across ~150 Bash calls. In those transcripts no recovery files were read and no compressed pipe produced a wrong count (the full runs saw exactly one recovery-file read); the extra turns were overwhelmingly the model choosing different solution paths, not rtk confusion. On the full runs, task scores landed at 5 better / 4 worse / 71 tie at low effort and 5 / 4 / 62 at high (sign test p=1.0 both); showing the arms are statistically indistinguishable on quality, with partial credit counted.
One honest asterisk: on one task (dialogue-parser) rtk’s own binary refused to start inside the task’s image (it needs a newer glibc), so the with-rtk trial died at setup in both full runs while the plain arm scored 0.667. Paired analysis excludes that task from both arms, but it’s a real compatibility failure, not Docker noise. Even scoring every errored trial as zero, the arms stay tied (sign test p=1.0).
Finding 5: rtk’s own scoreboard vs the bill
This is the finding that explains the gap. Across the low-effort full run, rtk’s built-in analytics (rtk gain) reported 96.2 million tokens saved — 99.8% of everything it touched; while the measured bill for the same trials went up. Three mechanisms make the scoreboard read high:
First, rtk counts the full raw output as its counterfactual. One cat of a 1.2 MB CSV logged 320k tokens “saved”, but Claude Code truncates any tool result long before 320k tokens; so the agent would have received a few thousand either way. The full run logged 190 of such giant reads at an average of ~506k “saved” tokens each. Second, rtk estimates tokens as chars÷4 at the moment of execution, while most of a session’s input cost is cached re-reads billed at a tenth of the price. Third, the hook simply never sees the majority of context. The scoreboard is grading its own homework.
Verdict
Honest engineering, wrong counterfactual. We wanted this one to win; the demo is genuinely satisfying to play with. The filters are real and often elegant; quality doesn’t suffer; the hook mechanism works exactly as designed. But on real agentic coding work the advertised 60–90% never had anywhere to live: the hook only ever sees about a fifth of the tool output, Claude Code already truncates the pathological outputs rtk brags about compressing, and the cached re-reads that dominate input cost bill at a tenth of the price. What’s left is a measured median +7.6% cost increase at low effort and a flat zero at high effort, a thin tax from a broken rewrite here and an extra exploration turn there, never a saving.
The deeper lesson generalizes beyond rtk: a tool’s self-reported savings are a claim about its counterfactual, not about your bill. rtk’s scoreboard said 96 million tokens saved while the invoice went up. If you evaluate any context-compression tool, measure the paired bill, not the tool’s diff.
Methodology notes
Same discipline as part 1, learned the expensive way:
Never trust k=1. The run ladder was: free transcript replay → 1-trial wiring check → 10 Bash-heavy tasks at k=1 → the same 10 at k=3 → the full 86 at k=1, twice (low and high effort). Per-task scores flip freely between attempts in both arms; only paired deltas that survive the ladder get reported.
Paired analysis only. Every number compares the same task across arms under the same job; tasks that errored in either arm are excluded from both. Quality uses an exact sign test over non-ties; token/cost deltas use per-task medians plus Wilcoxon signed-rank, because arm totals are outlier-dominated, a single session crossing the 200k long-context pricing tier can bill 25× normal and flip a raw total.
Endpoints pre-registered. Primary: per-task paired delta in cost and in “new input” tokens (uncached + cache-creation; where compressed tool results actually land). Decided before any paid run, along with the adoption-stratified split.
Adoption instrumented, not assumed. Every with-rtk trial persists rtk’s hook audit log and its history.db, so we can prove per-trial that rewrites fired and executed – and distinguish “rtk saved nothing” from “rtk never ran,” which are very different findings. Depending on the run, the hook rewrote a third to a half of the Bash calls it saw (33–50%, after discounting our own per-trial wiring check); the model itself typed rtk six times in 86 trials.
Provenance. rtk v0.43.0 release binary (sha256-pinned), Claude Code 2.1.201 pinned in both arms, claude-sonnet-5, Harbor 0.18, SkillsBench with bike-rebalance excluded (its allow_internet=false crashes local Docker jobs). rtk, Harbor and SkillsBench are all Apache-2.0.
Next in the series: drop a tool name and we’ll put it on the ladder. Few word enough. We test.
P.S. The dithered chart style in this post is borrowed with admiration from dither-kit by grim — reimplemented from scratch as a dependency-free inline widget.
News to Guide
ニュースの次に確認する
発表内容を、現在の料金や仕様と照らし合わせられる関連ガイドです。
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み