v2.12.9 fix inflated savings
Critical Fix: Inflated Token Savings
What was wrong
ctx_tree was comparing compact output against a full recursive directory walk (no depth limit, all hidden files). For a project with 50K files, each ctx_tree call reported ~500K "saved" tokens instead of the real ~100.
Additionally:
- Cache hit tracking counted every tool call with any savings as a "cache hit"
- Output savings model added 330 phantom tokens per call
What we fixed
- ctx_tree raw comparison now uses same depth and hidden settings as compact output
- record_cache_hit() only fires for actual ctx_read cache re-reads
- Output savings bonus reduced from 330 to 60 tokens/call
How to fix your dashboard
Run: lean-ctx gain --reset
This clears all inflated historical data. New stats will be accurate.
Install
cargo install lean-ctx | brew install yvgude/lean-ctx/lean-ctx | npm i -g lean-ctx-bin
Full Changelog: v2.12.8...v2.12.9