v2.21.1
CLI File Caching
Added — Persistent CLI Read Cache (#65)
- File-based CLI caching —
lean-ctx read <file>now caches file content to~/.lean-ctx/cli-cache/cache.json. Second and subsequent reads of unchanged files return a compact ~13-token cache-hit response instead of the full file content. This directly addresses Issue #65 (pi-lean-ctx zero cache hits) by enabling caching for CLI-mode integrations that don't use the MCP server. - Cache management — New
lean-ctx cachesubcommand withstats,clear, andinvalidate <path>actions. --fresh/--no-cacheflag — Bypass the CLI cache for a single read when needed.- 5-minute TTL — Cache entries expire after 300 seconds, matching the MCP server cache behavior.
- MD5 change detection — Files are re-read when their content changes, even within the TTL window.
- Max 200 entries — Oldest entries are evicted when the cache exceeds capacity.
- 6 new unit tests including integration test for full cache lifecycle.
Fixed — Missing Module Registrations
- Registered
sandboxandloop_detectionmodules that were present on disk but missing fromcore/mod.rs.
Upgrade
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxFull Changelog: v2.21.1...v2.21.1