Skip to content

v3.4.0

Choose a tag to compare

@yvgude yvgude released this 25 Apr 09:16
· 1238 commits to main since this release

Token Overhead Reduction, JSONC Support, XDG Compliance, Shell Hook Control

Addresses GitHub issues #150, #151, #152, #153.

Changed (BREAKING)

  • Lazy tools now the default — Only 9 core tools are exposed by default instead of 46. This reduces per-turn input token overhead by ~80%. Use LEAN_CTX_FULL_TOOLS=1 to opt back in to all tools. The ctx_discover_tools tool lets agents discover and load additional tools on demand. (#153)

Added

  • JSONC comment supportlean-ctx setup and all editor config writers now parse JSON with // and /* */ comments using a built-in JSONC stripper. Config files with comments (e.g. opencode.json) are no longer treated as invalid and overwritten. (#151)
  • XDG Base Directory compliance — New installs use $XDG_CONFIG_HOME/lean-ctx (default ~/.config/lean-ctx/) instead of ~/.lean-ctx. Existing ~/.lean-ctx directories are detected and used automatically — no migration required. (#152)
  • minimal_overhead config option — Set minimal_overhead = true in config or LEAN_CTX_MINIMAL=1 env var to skip session/knowledge/gotcha blocks in MCP instructions, minimizing token overhead for cost-sensitive workflows. (#153)
  • Shell hook disable — New --no-shell-hook flag for lean-ctx init, shell_hook_disabled = true config option, and LEAN_CTX_NO_HOOK=1 env var to disable the _lc() shell wrapper across all shells (bash, zsh, fish, PowerShell). MCP tools remain fully active. (#150)

Fixed

  • Shell hook source lines now use the resolved data directory path instead of hardcoded ~/.lean-ctx, matching XDG-compliant installations.
  • upsert_source_line detection works for both legacy and XDG hook paths (including Windows backslash paths).
  • Flaky CI test setup_bootstrap_doctor_status_json_smoke no longer fails when doctor --fix returns exit code 1 in environments without shell profiles.

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.
Important: Shell hooks changed in this release (LEAN_CTX_NO_HOOK check added). Run lean-ctx setup to get the updated _lc() function.

Full Changelog: v3.3.9...v3.4.0