github yvgude/lean-ctx v3.9.8

3 hours ago

Added

  • Smart Read redirect for Cursor (auto mode).
    Native Read calls in Cursor are now transparently compressed via lean-ctx's
    auto mode — selecting the optimal compression (signatures, map, etc.) per
    file for 87-97% token savings. Windowed reads (offset/limit) remain verbatim
    (full-compact) to preserve line indexing. Validated by edit-probe PoC:
    StrReplace does NOT fire a Read PreToolUse, so the redirect is safe.
  • Replace mode hardening for all agents.
    • Claude Code / CodeBuddy: content-aware CLAUDE.md block updates; Replace
      mode block is now correctly installed even when block version matches.
    • Codex: mode-aware pretooluse handler — denies Bash in Replace mode,
      rewrites in Hybrid mode. Removed dead install_codex_deny_hook.
    • Pi: propagates replace mode to extension config + dedicated
      PI_AGENTS_REPLACE.md template.
    • Qoder: deny hooks for Read|Grep|Glob in Replace mode + replace rules.
    • Crush / Hermes: mode-aware rules installation via replace_rules_content().
    • CodeBuddy added to REPLACE_AGENTS.
  • lean-md addon integration (PR #721). External addon by @dasTholo
    directive-driven Markdown for agent plans. Reverse-cut: renderer lives in
    dasTholo/lean-md, lean-ctx hosts only the thin surface (registry entry,
    LSP formatter routing, RenderTransform trait, .lmd.md raw read).
  • SessionStart nudge improvements. Explicit ctx_read cache statistics
    for shared-mode hosts (Cursor); fixed stale ctx_semantic_search reference.

Fixed

  • Cursor Read redirect regression (GH #1250 follow-up).
    install_cursor_deny_hook was re-adding the Read redirect that
    merge_cursor_hooks had removed, causing cli_full traffic with 0%
    compression (1.4M tokens wasted). Now correctly separated: Read → redirect
    (smart compression), Grep|Glob → deny.
  • Cursor Glob deny. Added Glob to the deny matcher alongside Grep —
    forces use of ctx_glob instead of native Glob.
  • Claude/CodeBuddy CLAUDE.md not updating in Replace mode. Block
    installer now checks content (not just version) to detect stale blocks.
  • lean-md registry integration: "mcp""none". Invalid enum value
    from PR #721 corrected; IntegrationKind::parse("mcp") silently returned
    None.
  • Codex integration test adjusted. agent_init_codex test updated from
    3 to 2 PreToolUse entries after removing the separate deny hook.

Changed

  • redirect_read_args() now returns Vec<String> with dynamic mode
    selection instead of a fixed [&str; 4] array.
  • refresh_agent_hooks() is now fully mode-aware — determines the
    recommended HookMode per agent and installs the correct artifacts.
  • Removed PoC edit_probe handler (served its diagnostic purpose).

Upgrade

lean-ctx update                 # recommended (auto-downloads + refreshes shell hooks)
cargo install lean-ctx          # or
npm update -g lean-ctx-bin      # or
brew upgrade lean-ctx

Note: After upgrading via cargo/npm/brew, run lean-ctx setup to refresh shell aliases. lean-ctx update does this automatically.

Full Changelog: v3.9.8...v3.9.8

Don't miss a new lean-ctx release

NewReleases is sending notifications on new releases.