github yvgude/lean-ctx v2.12.7
v2.12.7 — MCP Tool Enforcement + Token Optimization + 19 IDE Coverage

latest releases: v3.8.18, v3.8.17, v3.8.16...
3 months ago

Highlights

MCP Tool Enforcement — LLMs now reliably use lean-ctx MCP tools instead of native tools across all 19 supported IDEs/agents through a 3-layer strategy:

  1. PreToolUse Hooks — Soft-redirect hooks for Claude Code, Cursor, and Gemini CLI intercept native Read, Grep, ListFiles calls and guide LLMs to ctx_read/ctx_search/ctx_tree. Safety fallback ensures native tools work if MCP server is unreachable.
  2. LITM-Optimized Rules v5 — Critical instructions placed at beginning AND end of rules blocks (exploiting LLM attention patterns).
  3. Project-Level Reinforcement — Auto-creates AGENTS.md and .cursorrules on lean-ctx init --agent.

Token Optimization Deep Dive — Performance improvements across all phases:

  • Config caching with OnceLock, stats batching, deferred writes
  • 20+ new compression patterns (cargo, git, docker, npm, uv/conda/poetry)
  • Trimmed tool descriptions, strengthened CRP/TDD output constraints

Added

  • 6 new IDE/agent rules targets: Qwen Code, Trae, Amazon Q Developer, JetBrains, Antigravity, Pi Coding Agent
  • 19 total supported IDEs/agents (up from 13)
  • Auto-refresh hooks + rules on lean-ctx update and MCP server start
  • Complete uninstall cleanup for rules files (13 locations), hook scripts (7 files), and configs

Changed

  • Removed double savings footer, compressed entropy/stale headers
  • Stats batching with in-memory accumulator + periodic flush
  • Fixed npm test heuristic (proper Jest/Vitest parsing)
  • Hook installation refactored for reusability

Full changelog: https://github.com/yvgude/lean-ctx/blob/main/CHANGELOG.md

Full Changelog: v2.12.6...v2.12.7

Don't miss a new lean-ctx release

NewReleases is sending notifications on new releases.