Benchmark

Nie ufaj. Zweryfikuj.

Measured on 1,794 real commands and 50 files across 9 languages. Exact token counts with tiktoken. Reproducible on your codebase.

30-minute session.

A real coding session: 50 files, multiple re-reads, shell commands. Measured with tiktoken (cl100k_base) on the lean-ctx codebase itself (Rust + TypeScript + Python, ~50K LOC).

lean-ctx benchmark dual-arm --json measured
30-min session simulation
Raw (no compression) 605,400 tokens $1.51
lean-ctx (all modes) 84,400 tokens $0.21
lean-ctx + CRP 79,900 tokens $0.20
Breakdown
File reads (50 files) 96.5% avg savings
Shell commands (1,794) 59.9% avg savings
Re-reads (session cache) ~13 tokens each
tiktoken cl100k_base −86.1%

Every number on this page is reproducible. On your codebase.

Shell compression.

56 domain-specific compression modules for git, cargo, npm, docker, terraform, kubectl. Measured on 1,794 real commands from production usage.

lean-ctx gain --json production
Command Raw Compressed Saved
git log --stat -10 8,693 636 92.7%
git diff HEAD~5 --stat 3,077 179 94.2%
git log --oneline -50 3,431 1,221 64.4%
git status 2,350 1,585 32.6%
Total input: 91,344,503 tokens
Total saved: 54,733,233 tokens
Avoided cost: $136.83
1,794 commands measured −59.9%

Read compression.

Auto-selects the optimal read mode per file. Measured on 50 files across 9 languages with tiktoken exact counts.

Explore read modes
lean-ctx benchmark run src/ 50 files
Language Files Raw Tokens Best Mode Saved
.rs 10 144,295 map 96.5%
.js 10 71,352 map 99.1%
.ts 4 13,974 map 95.6%
.py 9 26,688 signatures 94.5%
.md 10 80,376 aggressive 5.6%
.json 5 67,430 aggressive 0.5%
Note: Markdown/JSON are data files — structural modes
only apply to programming languages.
27 languages · tree-sitter 96–99% on code

Tryby czytania W porównaniu do

Each mode preserves different information. auto picks the best one based on file type, size, and task context.

ModeSavingsQualityUse case
map97.4%81%Dependencies + API surface
signatures96.6%90%Function/class signatures
cache_hit99.8%Re-reads from session cache
diff80–95%100%After edits
aggressive75–90%100%Large boilerplate files
entropy70–83%100%Shannon + Jaccard filtering
task65–85%95%+Query-conditioned extract
auto70–99%95%+LeanCTX picks best mode

Reproduce locally.

Every number on this page is reproducible. Three commands.

terminal
$ lean-ctx benchmark run src/ # per-file, per-mode savings
$ lean-ctx benchmark run . --json # raw JSON data
$ lean-ctx gain # cumulative production stats
$ lean-ctx gain --json # stats as JSON
# Deterministic dual-arm comparison (no live model)
$ lean-ctx benchmark dual-arm --json # BLAKE3-fingerprinted
tiktoken o200k_base · deterministic reproducible

Methodology, explained.

How we measure, what we guarantee, and how you can verify.

Zmierz swojerzeczywiste oszczędności.

Zainstaluj LeanCTX i uruchom <code class="text-[12px] text-accent">benchmark run</code> na swojej bazie kodu. Rzeczywiste liczby, Twoje pliki, Twoje oszczędności.

curl -fsSL https://leanctx.com/install.sh | sh
Support this project