Benchmark
Đừng tin tưởng. Hãy xác minh.
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).
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.20Breakdown File reads (50 files) 96.5% avg savings Shell commands (1,794) 59.9% avg savings Re-reads (session cache) ~13 tokens eachEvery 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.
Command Raw Compressed Savedgit 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.83Read compression.
Auto-selects the optimal read mode per file. Measured on 50 files across 9 languages with tiktoken exact counts.
Explore read modesLanguage 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 modesonly apply to programming languages.Các Chế độ Đọc So với
Each mode preserves different information. auto picks the best one based on file type, size, and task context.
| Mode | Savings | Quality | Use case |
|---|---|---|---|
map | 97.4% | 81% | Dependencies + API surface |
signatures | 96.6% | 90% | Function/class signatures |
cache_hit | 99.8% | — | Re-reads from session cache |
diff | 80–95% | 100% | After edits |
aggressive | 75–90% | 100% | Large boilerplate files |
entropy | 70–83% | 100% | Shannon + Jaccard filtering |
task | 65–85% | 95%+ | Query-conditioned extract |
auto | 70–99% | 95%+ | LeanCTX picks best mode |
Reproduce locally.
Every number on this page is reproducible. Three commands.
$ 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-fingerprintedMethodology, explained.
How we measure, what we guarantee, and how you can verify.
Rust bindings to tiktoken (o200k_base for GPT-4o, cl100k_base approximation for Claude). Exact counts, not char/4 estimates.
Compressed output is only used if composite quality ≥ 95% (AST 50% + identifiers 30% + lines 20%). Below that, the file ships verbatim.
Yes. Run lean-ctx benchmark run src/ --json on any codebase. Same inputs → same outputs, deterministic.
The fixed per-session footprint (tool schemas + MCP instructions) is ~2.1K tokens, enforced in CI via --gate. lean-ctx gain reports savings net of this overhead.
Đo lườngkhoản tiết kiệm thực tế của bạn.
Cài đặt LeanCTX và chạy <code class="text-[12px] text-accent">benchmark run</code> trên codebase của bạn. Các con số thực tế, các tệp của bạn, khoản tiết kiệm của bạn.
curl -fsSL https://leanctx.com/install.sh | sh