Files
wehub-resource-sync 26382a7ac6
CI / Test (macos-latest) (push) Waiting to run
CI / Test (ubuntu-latest) (push) Waiting to run
CI / Test (windows-latest) (push) Waiting to run
CI / Clippy (push) Waiting to run
CI / Build (no embeddings / no ORT) (push) Waiting to run
CI / Format (push) Waiting to run
CI / Cookbook (Node) (push) Waiting to run
CI / Pi Extension (Node) (push) Waiting to run
CI / Rust SDK (lean-ctx-client) (push) Waiting to run
CI / Embed SDK (lean-ctx-sdk) (push) Waiting to run
CI / Python SDK (leanctx) (push) Waiting to run
CI / Hermes Plugin (Python) (push) Waiting to run
CI / SDK Conformance Matrix (push) Waiting to run
CI / Coverage (push) Waiting to run
CI / cargo-deny (push) Waiting to run
CI / Adversarial Safety (push) Waiting to run
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
JetBrains Plugin / Actionlint (push) Waiting to run
CI / Benchmarks (push) Waiting to run
CI / Output-Quality Gate (eval A/B) (push) Waiting to run
CI / Documentation (push) Waiting to run
CI / CI Green (push) Blocked by required conditions
CodeQL / Analyze (actions) (push) Waiting to run
CodeQL / Analyze (rust) (push) Waiting to run
JetBrains Plugin / Validation (push) Waiting to run
JetBrains Plugin / Build (push) Waiting to run
JetBrains Plugin / Test (push) Blocked by required conditions
Security Check / Security Scan (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 12:35:30 +08:00
..

lean-ctx VS Code Extension

VS Code Marketplace Open VSX

VS Code sidebar extension for lean-ctx — the context engineering layer for AI agents. Works in VS Code, Cursor, VSCodium and Windsurf.

Features

  • Dashboard — Token savings, session stats, and file activity at a glance
  • Knowledge Panel — Browse decisions, discoveries, blockers, and insights from the current session
  • Repo Map — Interactive view of the most important files in your project, ranked by relevance
  • Semantic Search — Search your codebase by meaning, not just text
  • Status Bar — Live token savings counter with one-click dashboard access
  • Setup & Doctor — Configure shell + editors and run diagnostics from the command palette
  • One-click MCP wiring — Write a workspace .vscode/mcp.json entry for lean-ctx
  • Visualizer — Launch the lean-ctx call graph visualizer

Prerequisites

  • lean-ctx installed (curl -fsSL https://leanctx.com/install.sh | sh). The extension auto-detects the binary on PATH, ~/.cargo/bin and Homebrew.
  • VS Code 1.80.0 or later (or a compatible editor: Cursor, VSCodium, Windsurf)

Installation

From the VS Code Marketplace

In VS Code: open Extensions (Ctrl/Cmd+Shift+X), search lean-ctx, click Install — or:

code --install-extension LeanCTX.lean-ctx

From Open VSX (Cursor, VSCodium, Windsurf)

These editors use the Open VSX registry. Search lean-ctx in the Extensions view, or:

cursor --install-extension LeanCTX.lean-ctx     # Cursor
codium --install-extension LeanCTX.lean-ctx     # VSCodium

From Source

cd vscode-extension
npm install
npm run compile
npm run package
code --install-extension lean-ctx-0.1.0.vsix

Development

cd vscode-extension
npm install
npm run watch
# Press F5 in VS Code to launch Extension Development Host

Configuration

Setting Default Description
leanctx.binaryPath "" (auto-detect) Path to the lean-ctx binary. Empty → auto-detect on PATH, ~/.cargo/bin, Homebrew
leanctx.refreshInterval 30 Status bar refresh interval (seconds)

Commands

Command Description
lean-ctx: Semantic Search Opens a search input for semantic code search
lean-ctx: Show Repo Map Switches to the repo-map tab in the sidebar
lean-ctx: Knowledge Panel Switches to the knowledge tab in the sidebar
lean-ctx: Open Visualizer Launches the lean-ctx call graph visualizer
lean-ctx: Refresh Dashboard Manually refreshes all dashboard data
lean-ctx: Setup Auto-configures shell + editors (lean-ctx setup)
lean-ctx: Doctor Runs diagnostics (lean-ctx doctor) in an output channel
lean-ctx: Show Token Savings Shows the savings recap (lean-ctx gain)
lean-ctx: Show Context Heatmap Shows the context heatmap (lean-ctx heatmap)
lean-ctx: Open Web Dashboard Opens the dashboard as a native editor tab (webview). Also reachable from the terminal via lean-ctx dashboard --vscode
lean-ctx: Configure MCP for this workspace Writes a .vscode/mcp.json stdio entry for lean-ctx

Architecture

src/
├── extension.ts          # Entry point: activate/deactivate
├── leanctx.ts            # CLI interface + binary auto-detection
├── commands.ts           # Sidebar command handlers (search, repomap, …)
├── cli-commands.ts       # CLI-backed commands (setup, doctor, MCP wiring)
├── dashboard-panel.ts    # Native dashboard webview tab (owns a private server)
├── uri-handler.ts        # vscode://LeanCTX.lean-ctx/… deep links (--vscode)
├── statusbar.ts          # Status bar item with auto-refresh
└── sidebar/
    ├── provider.ts       # Webview view provider
    └── panel.html        # Dashboard UI (HTML/CSS/JS)

All communication with lean-ctx happens via CLI subprocess calls in leanctx.ts. The sidebar uses a webview with VS Code's native CSS variables for seamless theming.