Disclosure: Measured directly on an Apple M4 Mac mini running rtk 1.2.1 without global agent hooks enabled. See our Japanese Home or Privacy & Disclosure Policy for methodology standards.

rtk (Rust Token Killer) M4 Mac mini Benchmark: Up to 87.3% CLI Token Reduction

Executive Summary (3 Takeaways)
  • Measuring rtk 1.2.1 on Apple M4 Mac mini showed -87.3% byte reduction on passing pytest runs (726 B → 92 B) and -39.3% on git log -n 20 (5,704 B → 3,460 B).
  • Compression gains vary steeply by command: a working tree with 30+ untracked files saw only -6.5% on git status, and custom Astro formatter output on npm run build dropped just -1.7%.
  • Because compaction can strip long commit bodies or debugging clues, leave global rtk init hooks off initially and invoke rtk test / rtk git log explicitly where ROI is clear.
pytest (via rtk test)
-87.3%
726 B → 92 B (182 → 23 tok)
git log -n 20
-39.3%
5,704 B → 3,460 B (1,400 → 839 tok)
git status
-6.5%
2,078 B → 1,943 B (520 → 486 tok)
npm run build
-1.7%
2,082 B → 2,046 B (504 → 495 tok)

1. Why CLI Stdout Bloat Hurts Coding Agents

Autonomous coding agents feed command stdout straight back into the prompt window on every iteration. Test progress dots and verbose commit headers accumulate turn over turn, inflating prompt-cache footprints and eating through weekly cloud quotas. We benchmarked rtk 1.2.1 (installed via Homebrew, global hooks disabled) across real repositories on an Apple M4 Mac mini to measure real savings versus information loss.

2. Raw vs Compressed Benchmark Results

Estimated tokens are calculated uniformly as ceil(len(text) / 4) across both raw and compressed outputs.

Figure 1: Measured Byte Reduction by Command (rtk 1.2.1 on M4 Mac mini)

0% 25% 50% 75% 100% rtk test .venv/bin/pytest 87.3% rtk git log -n 20 39.3% rtk git status 6.5% rtk npm run build 1.7%
Command Raw Output (bytes / lines / est. tok) rtk Output (bytes / lines / est. tok) Byte Reduction Wall Time (Raw → rtk)
rtk test .venv/bin/pytest 726 B / 13 lines / 182 tok 92 B / 2 lines / 23 tok -87.3% 0.28s → 0.17s
rtk git log -n 20 5,704 B / 154 lines / 1,400 tok 3,460 B / 37 lines / 839 tok -39.3% 0.01s → 0.01s
rtk git status 2,078 B / 40 lines / 520 tok 1,943 B / 34 lines / 486 tok -6.5% 0.01s → 0.03s
rtk npm run build 2,082 B / 42 lines / 504 tok 2,046 B / 37 lines / 495 tok -1.7% 1.47s → 0.91s

3. Compaction Behavior & Information-Loss Audit

# Install via Homebrew (global rtk init hooks kept disabled)
brew install rtk
rtk --version  # rtk 1.2.1

# Call rtk explicitly where compression ROI is highest
rtk test .venv/bin/pytest
rtk git log -n 20
rtk git status

4. Honest Trade-offs: Why Global Hooks Stay Disabled

Two Practical Caveats Before Enabling Everywhere
  • Debugging context loss risk: Enabling global rtk init hooks rewrites outputs indiscriminately across tool calls, which can hide subtle build warnings or multi-line commit context during incident debugging.
  • Wrapper ergonomics: Subcommands differ slightly from raw binaries (such as rtk test instead of rtk pytest), so explicit invocation in scripts or targeted agent calls is safer and more predictable.

5. Frequently Asked Questions (FAQ)

Does rtk (Rust Token Killer) reduce every CLI command output by 80% or more?

No. In our M4 Mac mini (rtk 1.2.1) benchmark, pytest via rtk test dropped by 87.3% (726 B to 92 B) and git log -n 20 by 39.3% (5,704 B to 3,460 B), while git status with 30+ untracked files dropped 6.5% and Astro npm run build dropped only 1.7%.

Can I invoke rtk pytest directly as a subcommand?

No. rtk 1.2.1 has no standalone rtk pytest top-level subcommand; wrap pytest through rtk test .venv/bin/pytest and check rtk --help for supported wrappers.

Should coding agents enable global rtk init hooks on day one?

We advise against blanket global hooks during active debugging. Compaction can omit multi-line commit bodies, change stats, or subtle compiler/build warnings. Explicit calls for rtk test and rtk git log preserve safety while cutting recurring token bloat.

Does rtk add noticeable latency to local tests or builds?

As a native Rust binary, overhead is minimal: git status went 0.01s to 0.03s, git log -n 20 stayed 0.01s to 0.01s, pytest measured 0.28s to 0.17s, and npm run build measured 1.47s to 0.91s.

How does rtk complement a local M4 Mac mini LLM pipeline?

Compressing verbose test/git stdout via rtk cuts frontier prompt-cache consumption, while offloading repetitive extraction and classification to a local 27B Q2_0 node keeps daily marginal API spend near zero.

SiliconBench Topic Cluster

Explore Calculators & Core Benchmark Guides

Apple Silicon LLM RAM & Power Calculator →

Check unified-memory headroom and USD power costs

VPS vs Local Mac mini TCO Calculator →

Compare 3-year break-even points in USD

Speed (tok/s) & KV Cache Simulator →

Estimate bandwidth tok/s and 4k–128k KV cache scaling

Mac mini 24/7 Hardware & UPS Gear Guide →

USB4 40Gbps NVMe storage, smart meter, sine-wave UPS

M4 Mac mini 16GB Hybrid LLM Guide →

16.21 tok/s on 27B Q2_0 and 236 MB heap baseline

150-Round Thermal Endurance Benchmark →

0 thermal throttling alerts across 1K/4K/8K prompts