Added
- Plan mode support for VS Code, Claude Code, and Windsurf — New
plan_mode.rsmodule detects IDE plan/read-only contexts and exposes a curated subset of 12 read-only tools (ctx_read,ctx_search,ctx_tree,ctx_overview,ctx_plan,ctx_metrics,ctx_compress,ctx_session,ctx_knowledge,ctx_graph,ctx_retrieve,ctx_provider).lean-ctx setupauto-configures VS CodeplanAgent.additionalToolsand Claude Codepermissions.allowentries. Includeslean-ctx doctorplan mode status check - MCP
readOnlyHinttool annotations — All read-only MCP tools now declarereadOnlyHint: truein their tool definitions, enabling IDE plan agents to use them without explicit user approval. Write tools (ctx_edit,ctx_fill,ctx_delta,ctx_handoff,ctx_ledger,ctx_multi_read) correctly declarereadOnlyHint: false - Dynamic tool filtering — New
server/dynamic_tools.rsmodule filters exposed tools based on client capabilities. Plan-mode clients only see read-only tools; full-mode clients see all 62 tools - GitLab provider — Built-in GitLab data source provider (issues, merge requests, pipelines) activates automatically when
GITLAB_TOKENis set. Joins GitHub, Jira, and PostgreSQL as built-in providers - Provider consolidation pipeline (production-wired) —
apply_artifacts_to_stores()now runs in a background thread from bothctx_providerandctx_preload, indexing provider data into BM25, Graph, Knowledge, and Session Cache. Previously, provider data was only cached — now it's fully searchable, generates cross-source hints inctx_read, and contributes knowledge facts - MCP Bridge stdio transport support —
[providers.mcp_bridges.<name>]now acceptscommand+argsfor stdio-based MCP servers in addition to HTTPurl. Bridges register with unique IDs (mcp:<name>) and supportresources,read_resource, andtoolsactions - Cross-source hints in
ctx_read— When reading a file,ctx_readnow shows related issues, PRs, and external data linked via the graph index (e.g., "Related: [Issue] github://issues/42 — Auth bug") ctx_semantic_searchexternal result attribution — Search results from external providers now show clear type labels:[Issue],[PR],[Ticket],[Schema],[Wiki]with full provider URIslean-ctx doctorMCP bridge diagnostics — New diagnostic section validates configured MCP bridges (URL reachability, config completeness,auto_indexstatus warning)lean-ctx doctorplan mode check — Reports whether VS Code and Claude Code are configured for plan mode tool access- 13 wiring-proof integration tests — New
provider_wiring_proof.rstest suite proves every connection in the provider pipeline is functional (consolidation → BM25/Graph/Knowledge/Cache → search/hints/recall). Catches "functional silos" where code exists but isn't connected to runtime - 10 E2E provider pipeline scenarios — New
provider_pipeline_e2e.rscovers full pipeline, cross-source edges, knowledge extraction, MCP bridge registration, multi-source consolidation - Plan mode scenario tests — New
plan_mode_scenarios.rswith 11 tests covering VS Code settings injection, Claude Code permissions, idempotency, merge behavior, and status detection - Power user worksession test suite — New
power_user_worksession.rswith 12 end-to-end scenarios simulating a full coding session: initial read → edit → diff → search → knowledge → cache → overview → multi-read → compress → graph → context - Lock contention hardening tests — New
lock_contention_hardening.rswith 14 scenarios testing bounded lock timeouts, concurrent access, I/O health escalation, and WSL2/NFS environment detection LEAN_CTX_CLIENT_HINTenv override — Client capability detection can now be overridden for testing and edge-case environmentslean-ctx doctorprovider status — Shows active providers and their auth statuslean-ctx doctorCopilot CLI MCP check — Separate diagnostic for Copilot CLI MCP configuration (distinct from VS Code MCP)- VS Code Extension
.vscode/mcp.jsonsupport — New standard path withtype: "stdio"transport ctx_ledger resetclears cache delivery flags — Prevents stale "already delivered" states- Knowledge.json size warning — Warns when knowledge file exceeds 1 MB during load
- CLI smoke tests — New integration tests for
gain --json,grep,ls,doctorcommands
Fixed
- PowerShell
@argssplatting fails on single commands —_lcfunction now resolves the native command viaGet-Command -CommandType Applicationbefore invocation, preventing "not recognized" errors when@argsis used with compound argument strings - Fish shell
lean-ctx-offleaks env var —set -e LEAN_CTX_ENABLED(which removes the var) changed toset -gx LEAN_CTX_ENABLED 0(which sets it to 0), matching Bash/Zsh behavior and preventing child shells from re-activating - Bash/Zsh
lean-ctx-offleaks env var —unset LEAN_CTX_ENABLEDchanged toexport LEAN_CTX_ENABLED=0for consistent disable semantics across shells - Provider init ignores project root —
ctx_providerandctx_preloadnow callinit_with_project_root(Some(root))instead ofinit_builtin_providers(), enabling config-based provider discovery scoped to the actual project directory - Windows CI failure: dead
is_running_in_powershell()— Removed unused#[cfg(windows)]function that triggered-Dwarningsfailure onwindows-latestCI - Lock contention in 12 MCP tools —
ctx_read,ctx_edit,ctx_delta,ctx_fill,ctx_handoff,ctx_knowledge,ctx_multi_read,ctx_smart_read,ctx_prefetch,ctx_ledger,ctx_preload,ctx_providernow use bounded lock acquisition with adaptive timeouts instead of indefinite waits - Adaptive timeout death spiral — SlowFs/Degraded environments now get longer timeouts (1.5×/2×), not shorter, preventing cascading failures
- UTF-8 safe truncation — No more panics on multi-byte character boundaries in hook handlers,
ctx_read,ctx_overview, and server dispatch - Cache staleness for missing files — A missing file is now correctly treated as stale (previously wasn't)
compound_lexerUnicode — Switched from byte-based to char-based parsing; fixed$(…)subshell detection- Windows shell output decoding — Tries UTF-8 first, then Active Code Page (ACP) as fallback
ctx_readlock contention — Returns actionable error message instead of hanging silentlyctx_readnot-found — Provides actionable hint after retry failure- BM25 zstd decompression bomb — Bounded decode prevents memory exhaustion from malformed compressed index
- Copilot hooks merge — No longer overwrites existing hooks during setup
ctx_knowledgerehydrate time budget — Capped at 10 seconds to prevent blockingctx_executerespectsGIT_PAGER/PAGER— Only sets pager env vars when not already set by user
Changed
providers.auto_indexdefault is nowtrue— New installations automatically index provider data into BM25/Graph/Knowledge stores. Previously defaulted tofalse(cache-only)- MCP tool count — 61 → 62 (added
ctx_provider) - Tool descriptions — Updated
pkgdescin AUR packages anddescriptionin Cargo.toml to reflect 62 tools ctx_readpost-dispatch — Enrichment bounded to 3s; ledger/eviction/elicitation run async (no longer inline in output)- VS Code/Copilot client detection — Now also recognizes "Visual Studio Code" and "vscode" client identifiers
- Knowledge rehydrate limit — Maximum archives reduced from 12 to 4 for faster startup
- Shell pattern pipeline — ANSI-stripped output flows through all compressor stages
Removed
- Dead code cleanup — Removed
Config::providers_mcp_bridges()(unused afterinit.rsrefactoring),hints_from_index()(unused wrapper),is_running_in_powershell()(Windows-only, never called), unusedProjectIndeximport - Inline eviction/elicitation hints in
ctx_readresponse — Now only debug-logged, no longer appended to tool output
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.6.13...v3.6.13