Changed
- Eliminate
CliRedirecthook mode — Removed theHookMode::CliRedirectvariant entirely. All agents now use eitherHybrid(MCP for reads/search + shell hooks for command compression) orMcp(MCP only). Cursor and Gemini CLI, previously CliRedirect, are now Hybrid with full MCP support. This ensures reads and searches always go through the cached MCP path while shell commands are compressed via hooks — the best of both worlds. - Cursor: automatic MCP installation —
lean-ctx init --agent cursorandlean-ctx setupnow automatically install the lean-ctx MCP server config in~/.cursor/mcp.jsonwith all 50+ tools auto-approved. Previously, CliRedirect mode actively prevented MCP installation, causing Cursor to miss cached reads and search compression. - Gemini CLI: Hybrid mode with MCP — Gemini CLI now gets MCP server config alongside its shell hooks, enabling cached reads via
ctx_readwhile preserving shell compression via hooks. - All agents default to Hybrid —
recommend_hook_mode()now returnsHybridfor all agents with shell access (Cursor, Gemini, Codex, Claude Code, OpenCode, Crush, Hermes, Pi, Qoder, Windsurf, Amp, Cline, Roo, Copilot, Kiro, Qwen, Trae, Antigravity, Amazon Q, Verdent). Only unknown agents without shell access fall back toMcp. - Hybrid rules template v2 — Updated
.cursor/rules/lean-ctx.mdctemplate to clearly instruct agents to usectx_readandctx_search(MCP) for reads/search, andlean-ctx -c(CLI) for shell commands. - SKILL.md updated — Removed
--mode cli-redirectexamples, updated to show Hybrid as the default mode for all agents.
Added
LEAN_CTX_QUIET=1production mode — New environment variable that suppresses all informational output for production use: savings footers ([lean-ctx: X→Y tok, -Z%]), session-start hook messages, tee-log hints, and verbose reroute messages. Shell compression still runs — only the human-visible annotations are hidden. Codex users can set this in~/.codex/config.tomlunder[mcp_servers.lean-ctx.env]to match default Codex output verbosity.- Redirect subprocess timeout increased —
handle_redirecttimeout increased from 3s to 10s for more reliable operation on slow filesystems.
Removed
HookMode::CliRedirect— Enum variant, all match arms,CLI_REDIRECT_RULESconstant,build_cli_redirect_instructions()function, and thelean-ctx-cli-redirect.mdctemplate file have been removed.DedicatedCliRedirect/CursorMdcCliRedirect— Rules injection variants removed fromrules_inject.rs.disable_agent_mcp()call path — Theinit_cmd.rscode path that calleddisable_agent_mcp()for CliRedirect agents has been removed. All agents now callconfigure_agent_mcp().
Fixed
- Cursor reads/search not using MCP — Root cause: CliRedirect mode prevented MCP installation, and
.cursorrules/ rule files instructed CLI-first usage. Now all rule files consistently instruct Hybrid mode (MCP reads + CLI shell). - Inconsistent rule files —
.cursorrules,AGENTS.md, project-level and global.cursor/rules/lean-ctx.mdcnow all consistently instruct Hybrid mode instead of conflicting CLI-first vs MCP-first directives.
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-ctxNote: After upgrading via cargo/npm/brew, run
lean-ctx setupto refresh shell aliases.lean-ctx updatedoes this automatically.
Full Changelog: v3.5.24...v3.5.24