Skip to content

v2.6.0 — Scientific Optimization

Choose a tag to compare

@yvgude yvgude released this 27 Mar 20:30

What's New

Scientific Optimization Suite

This release brings information-theoretic and attention-aware optimization to lean-ctx, pushing context compression closer to the theoretical optimum.

New Core Modules:

  • Adaptive per-language entropy thresholds — Entropy compression now uses language-specific BPE thresholds (Rust 0.85, Python 1.2, JSON 0.6) with Kolmogorov complexity adjustment
  • Task-conditioned compression — BFS-based relevance scoring through the dependency graph with keyword matching
  • Heuristic attention prediction — U-shaped positional attention model combined with structural importance scoring (definitions > errors > control flow > imports)
  • Cross-file TF-IDF codebook — Identifies boilerplate patterns across files and creates compact references
  • Information Bottleneck filter — Approximates optimal compression with task relevance preservation
  • Feedback loop — Learns optimal compression parameters from session outcomes

New MCP Tool:

  • ctx_overview — Multi-resolution project map with task-conditioned relevance scoring. Shows which files to read at which detail level for any given task.

CEP Enhancements:

  • Output token budget guidance (Mechanical: 50 tok, Standard: 200, Architectural: full)
  • Prefix-cache aligned system prompt for optimal KV-cache reuse
  • ctx_dedup now includes TF-IDF cosine similarity for semantic duplicate detection

Install

cargo install lean-ctx
# or
brew tap yvgude/lean-ctx && brew install lean-ctx
# or
npx lean-ctx-bin@2.6.0

Full Changelog: v2.5.3...v2.6.0