LEAN-CTX(1)

NAME

lean-ctx β€” Hybrid Context Optimizer β€” Shell Hook + MCP Server. Reduces LLM token consumption by 89-99%. Single Rust binary, zero…

SYNOPSIS

$npm install -g lean-ctx-bin

INFO

460 stars
60 forks
0 views

DESCRIPTION

Hybrid Context Optimizer β€” Shell Hook + MCP Server. Reduces LLM token consumption by 89-99%. Single Rust binary, zero dependencies.

README

  β–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—
  β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•
  β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘        β–ˆβ–ˆβ•‘    β•šβ–ˆβ–ˆβ–ˆβ•”β• 
  β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘        β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— 
  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘    β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•—
  β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β•β•β•     β•šβ•β•β•β•β•β•   β•šβ•β•   β•šβ•β•  β•šβ•β•
             The Intelligence Layer for AI Coding

The Intelligence Layer for AI Coding

Shell Hook + Context Server Β· 25 tools Β· 90+ patterns Β· Single Rust binary

CI Security crates.io Downloads npm pi-lean-ctx AUR License Discord X/Twitter Zero Telemetry

Website Β· Install Β· How It Works Β· Tools Β· Patterns Β· Changelog Β· Discord



lean-ctx reduces LLM token consumption by up to 99% through three complementary strategies in a single binary β€” making AI coding faster, cheaper, and more effective.


⚑ What It Does

  Without lean-ctx:                              With lean-ctx:

LLM ──"read auth.ts"──▢ Editor ──▢ File LLM ──"ctx_read auth.ts"──▢ lean-ctx ──▢ File β–² β”‚ β–² β”‚ β”‚ β”‚ ~2,000 tokens (full file) β”‚ β”‚ ~13 tokens (cached) β”‚ cache+hash β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ └────── (compressed) β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

LLM ──"git status"──▢ Shell ──▢ git LLM ──"git status"──▢ lean-ctx ──▢ git β–² β”‚ β–² β”‚ β”‚ β”‚ ~800 tokens (raw output) β”‚ β”‚ ~150 tokens β”‚ compress β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ └────── (filtered) β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

StrategyHowImpact
Shell HookTransparently compresses CLI output (90+ patterns) before it reaches the LLM60-95% savings
Context Server25 MCP tools for cached reads, mode selection, deltas, dedup, memory74-99% savings
AI Tool HooksOne-command integration via lean-ctx init --agent <tool>Works everywhere

🎯 Token Savings β€” Real Numbers

OperationFreqWithoutWith lean-ctxSaved
File reads (cached)15Γ—30,00019599%
File reads (map mode)10Γ—20,0002,00090%
ls / find8Γ—6,4001,28080%
git status/log/diff10Γ—8,0002,40070%
grep / rg5Γ—8,0002,40070%
cargo/npm build5Γ—5,0001,00080%
Test runners4Γ—10,0001,00090%
curl (JSON)3Γ—1,50016589%
docker ps/build3Γ—90018080%
Session total~89,800~10,62088%

Based on typical Cursor/Claude Code sessions with medium TypeScript/Rust projects. Cached re-reads cost ~13 tokens.


πŸš€ Get Started (60 seconds)

# 1. Install (pick one)
curl -fsSL https://leanctx.com/install.sh | sh     # universal, no Rust needed
brew tap yvgude/lean-ctx && brew install lean-ctx    # macOS / Linux
npm install -g lean-ctx-bin                          # Node.js
cargo install lean-ctx                               # Rust

2. Setup (auto-configures shell + ALL detected editors)

lean-ctx setup

3. Verify

lean-ctx doctor

Troubleshooting
ProblemFix
Commands broken?Run lean-ctx-off (fixes current session)
Permanent fix?Run lean-ctx uninstall (removes all hooks)
Binary missing?Aliases auto-fallback to original commands (safe)
Manual fix?Edit ~/.zshrc, remove the lean-ctx shell hook block
Preview changes?lean-ctx init --global --dry-run
Diagnose?lean-ctx doctor

lean-ctx creates a backup of your shell config before modifying it (~/.zshrc.lean-ctx.bak).

Supported editors (auto-detected by lean-ctx setup)
EditorMethodStatus
CursorMCP + hooks + rulesβœ… Auto
Claude CodeMCP + PreToolUse hooks + rulesβœ… Auto
GitHub CopilotMCPβœ… Auto
WindsurfMCP + rulesβœ… Auto
VS CodeMCP + rulesβœ… Auto
ZedContext Server (settings.json)βœ… Auto
Codex CLIconfig.toml + AGENTS.mdβœ… Auto
Gemini CLIMCP + hooks + rulesβœ… Auto
OpenCodeMCP + rulesβœ… Auto
Pipi-lean-ctx npm packageβœ… Auto
Qwen CodeMCP + rulesβœ… Auto
TraeMCP + rulesβœ… Auto
Amazon Q DeveloperMCP + rulesβœ… Auto
JetBrains IDEsMCP + rulesβœ… Auto
Google AntigravityMCP + rulesβœ… Auto
Cline / Roo CodeMCP + rulesβœ… Auto
AiderShell hook + rulesβœ… Auto
AmpShell hook + rulesβœ… Auto
AWS KiroMCP + rulesβœ… Auto
ContinueMCP + rulesβœ… Auto

🧠 Three Intelligence Protocols

CEP

Cognitive Efficiency Protocol

Adaptive LLM communication with compliance scoring (0-100), task complexity classification, quality scoring, auto-validation pipeline.

Measurable efficiency gains

CCP

Context Continuity Protocol

Cross-session memory that persists tasks, findings, decisions across chats. LITM-aware positioning for optimal attention placement.

-99.2% cold-start tokens

TDD

Token Dense Dialect

Symbol shorthand (Ξ» Β§ βˆ‚ Ο„ Ξ΅) and ROI-based identifier mapping for compact LLM communication.

8-25% extra savings


πŸ›  25 Intelligent Tools

Core

ToolPurposeSavings
ctx_readFile reads β€” 7 modes + lines:N-M, caching, fresh=true74-99%
ctx_multi_readMultiple file reads in one round trip74-99%
ctx_treeDirectory listings (ls, find, Glob)34-60%
ctx_shellShell commands with 90+ compression patterns60-90%
ctx_searchCode search (Grep)50-80%
ctx_compressContext checkpoint for long conversations90-99%

Intelligence

ToolWhat it does
ctx_smart_readAdaptive mode β€” auto-picks full/map/signatures/diff based on file type and cache
ctx_deltaIncremental updates β€” only sends changed hunks via Myers diff
ctx_dedupCross-file deduplication β€” finds shared imports and boilerplate
ctx_fillPriority-based context filling β€” maximizes info within a token budget
ctx_intentSemantic intent detection β€” classifies queries and auto-loads files
ctx_responseResponse compression β€” removes filler, applies TDD
ctx_contextMulti-turn session overview β€” tracks what the LLM already knows
ctx_graphProject intelligence graph β€” dependency analysis + related file discovery
ctx_discoverShell history analysis β€” finds missed compression opportunities

Memory & Multi-Agent

ToolWhat it does
ctx_sessionCross-session memory β€” persist task, findings, decisions across chats
ctx_knowledgePersistent project knowledge β€” remember facts, recall by query/category
ctx_agentMulti-agent sharing β€” register agents, post/read scratchpad, coordinate sessions
ctx_wrappedShareable savings report β€” "Spotify Wrapped" for your tokens

Analysis

ToolWhat it does
ctx_benchmarkSingle-file or project-wide benchmark with preservation scores
ctx_metricsSession statistics with USD cost estimates
ctx_analyzeShannon entropy analysis + mode recommendation
ctx_cacheCache management: status, clear, invalidate

πŸ“– ctx_read Modes

ModeWhen to useToken cost
fullFiles you will edit (cached re-reads β‰ˆ 13 tokens)100% first, ~0% cached
mapUnderstanding a file β€” deps + exports + API~5-15%
signaturesAPI surface with more detail than map~10-20%
diffRe-reading files that changedchanged lines only
aggressiveLarge files with boilerplate~30-50%
entropyRepetitive patterns (Shannon + Jaccard filtering)~20-40%
lines:N-MSpecific ranges (e.g. lines:10-50,80-90)proportional

πŸ”Œ Shell Hook Patterns (90+)

Pattern-based compression for 90+ commands across 34 categories:

View all 34 categories
CategoryCommandsSavings
Git (19)status, log, diff, add, commit, push, pull, fetch, clone, branch, checkout, switch, merge, stash, tag, reset, remote, blame, cherry-pick70-95%
Docker (10)build, ps, images, logs, compose ps/up/down, exec, network, volume, inspect70-90%
npm/pnpm/yarn (6)install, test, run, list, outdated, audit70-90%
Cargo (3)build, test, clippy80%
GitHub CLI (9)pr list/view/create/merge, issue list/view/create, run list/view60-80%
Kubernetes (8)get pods/services/deployments, logs, describe, apply, delete, exec, top, rollout60-85%
Python (7)pip install/list/outdated/uninstall/check, ruff check/format60-80%
Ruby (4)rubocop, bundle install/update, rake test, rails test60-85%
Linters (4)eslint, biome, prettier, stylelint60-70%
Build Tools (3)tsc, next build, vite build60-80%
Test Runners (8)jest, vitest, pytest, go test, playwright, cypress, rspec, minitest90%
Terraforminit, plan, apply, destroy, validate, fmt, state, import, workspace60-85%
Makemake targets, parallel jobs, dry-run60-80%
Maven / Gradlecompile, test, package, install, clean, dependency trees60-85%
.NETdotnet build, test, restore, run, publish, pack60-85%
Flutter / Dartflutter pub, analyze, test, build; dart pub, analyze, test60-85%
Poetry / uvinstall, sync, lock, run, add, remove; uv pip/sync/run60-85%
AWS (7)s3, ec2, lambda, cloudformation, ecs, logs, sts60-80%
Databases (2)psql, mysql/mariadb50-80%
Prisma (6)generate, migrate, db push/pull, format, validate70-85%
Helm (5)list, install, upgrade, status, template60-80%
Bun (3)test, install, build60-85%
Deno (5)test, lint, check, fmt, task60-85%
Swift (3)test, build, package resolve60-80%
Zig (2)test, build60-80%
CMake (3)configure, build, ctest60-80%
Ansible (2)playbook recap, task summary60-80%
Composer (3)install, update, outdated60-80%
Mix (5)test, deps, compile, format, credo/dialyzer60-80%
Bazel (3)test, build, query60-80%
systemd (2)systemctl, journalctl50-80%
Utils (5)curl, grep/rg, find, ls, wget50-89%
Data (3)env (filtered), JSON schema extraction, log dedup50-80%

After lean-ctx init --global, 23 commands are transparently compressed via shell aliases:

git Β· npm Β· pnpm Β· yarn Β· cargo Β· docker Β· docker-compose Β· kubectl Β· k
gh Β· pip Β· pip3 Β· ruff Β· go Β· golangci-lint Β· eslint Β· prettier Β· tsc
ls Β· find Β· grep Β· curl Β· wget

πŸ‘€ Examples

Directory listing β€” 239 β†’ 46 tokens (-81%)
# ls -la src/                               # lean-ctx -c "ls -la src/"
total 96                                     core/
drwxr-xr-x  4 user staff  128 ...           tools/
drwxr-xr-x  11 user staff 352 ...           cli.rs  9.0K
-rw-r--r--  1 user staff  9182 ...           main.rs  4.0K
-rw-r--r--  1 user staff  4096 ...           server.rs  11.9K
...                                          shell.rs  5.2K
                                             4 files, 2 dirs
                                             [lean-ctx: 239β†’46 tok, -81%]
File reading (map mode) β€” 2,078 β†’ ~30 tokens (-99%)
# Full read (284 lines, ~2078 tokens)       # lean-ctx read stats.rs -m map (~30 tokens)
use serde::{Deserialize, Serialize};         stats.rs [284L]
use std::collections::HashMap;                 deps: serde::
use std::path::PathBuf;                        exports: StatsStore, load, save, record, format_gain
                                               API:
#[derive(Serialize, Deserialize)]                cl βŠ› StatsStore
pub struct StatsStore {                          fn βŠ› load() β†’ StatsStore
    pub total_commands: u64,                     fn βŠ› save(store:&StatsStore)
    pub total_input_tokens: u64,                 fn βŠ› record(command:s, input_tokens:n, output_tokens:n)
    ...                                          fn βŠ› format_gain() β†’ String
(284 more lines)                             [2078 tok saved (100%)]
curl (JSON) β€” 127 β†’ 14 tokens (-89%)
# curl -s httpbin.org/json                   # lean-ctx -c "curl -s httpbin.org/json"
{                                            JSON (428 bytes):
  "slideshow": {                             {
    "author": "Yours Truly",                   slideshow: {4K}
    "date": "date of publication",           }
    "slides": [                              [lean-ctx: 127β†’14 tok, -89%]
      {
        "title": "Wake up to WonderWidgets!",
        ...
Visual terminal dashboard
$ lean-ctx gain

  β—† lean-ctx  Token Savings Dashboard
  ────────────────────────────────────────────────────────

   1.7M          76.8%         520          $33.71
   tokens saved   compression    commands       USD saved

  Cost Breakdown  (@ $2.50/M input, $10/M output)
  ────────────────────────────────────────────────────────
  Without lean-ctx    $44.75  ($5.79 input + $38.96 output)
  With lean-ctx       $11.04  ($1.76 input + $9.28 output)
  Saved               $33.71  ($4.03 input + $29.68 output)

  Top Commands
  ────────────────────────────────────────────────────────
  curl                48x  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 728.1K  97%
  git commit          34x  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž          375.2K  50%
  ctx_read           103x  β–ˆβ–Œ                    59.1K  38%
    ... +33 more commands

  lean-ctx v2.17.0  |  leanctx.com  |  lean-ctx dashboard

πŸ”¬ Scientific Compression Engine

Built on information theory and attention modeling (v2.6):

FeatureWhat it doesImpact
Adaptive EntropyPer-language BPE entropy + Jaccard thresholds with Kolmogorov adjustment10-25%
Attention ModelHeuristic U-curve positional weighting + structural importance scoring↑ comprehension
TF-IDF CodebookCross-file pattern dedup via cosine similarity5-15%
Feedback LoopLearns optimal thresholds per language/file type across sessionsauto-improving
Info BottleneckEntropy + task-relevance filtering (Tishby et al., 2000)20-40%
ctx_overviewMulti-resolution project map with graph-based relevance tiers90%+

🌳 tree-sitter Signature Engine

AST-based signature extraction for 18 languages: TypeScript, JavaScript, Rust, Python, Go, Java, C, C++, Ruby, C#, Kotlin, Swift, PHP, Bash, Dart, Scala, Elixir, Zig.

CapabilityRegex (old)tree-sitter
Multi-line signaturesβœ—βœ“
Arrow functionsβœ—βœ“
Nested classes/methodsHeuristicAST scope
Languages414

Build without tree-sitter for a smaller binary (~5.7 MB vs ~17 MB):

cargo install lean-ctx --no-default-features

πŸ“Š CLI Commands

Shell Hook
lean-ctx -c "git status"       # Execute + compress output
lean-ctx exec "cargo build"    # Same as -c
lean-ctx shell                 # Interactive REPL with compression
File Operations
lean-ctx read file.rs                         # Full content (structured header)
lean-ctx read file.rs -m map                  # Deps + API signatures (~10% tokens)
lean-ctx read file.rs -m signatures           # Function/class signatures only
lean-ctx read file.rs -m aggressive           # Syntax-stripped (~40% tokens)
lean-ctx read file.rs -m entropy              # Shannon entropy filtered (~30%)
lean-ctx read file.rs -m "lines:10-50,80-90"  # Specific line ranges
lean-ctx diff file1.rs file2.rs               # Compressed file diff
lean-ctx grep "pattern" src/                  # Grouped search results
lean-ctx find "*.rs" src/                     # Compact find results
lean-ctx ls src/                              # Token-optimized directory listing
lean-ctx deps .                               # Project dependencies summary
Setup & Analytics
lean-ctx setup                 # One-command setup: shell + editors + verify
lean-ctx init --global         # Install 23 shell aliases
lean-ctx init --agent claude   # Claude Code hook
lean-ctx init --agent cursor   # Cursor hooks.json
lean-ctx init --agent gemini   # Gemini CLI hook
lean-ctx init --agent codex    # Codex AGENTS.md
lean-ctx init --agent windsurf # .windsurfrules
lean-ctx init --agent cline    # .clinerules
lean-ctx init --agent pi       # Pi Coding Agent extension
lean-ctx gain                  # Visual terminal dashboard
lean-ctx gain --live           # Live auto-updating dashboard
lean-ctx gain --graph          # ASCII chart (30 days)
lean-ctx gain --daily          # Day-by-day breakdown
lean-ctx gain --json           # Raw JSON export
lean-ctx dashboard             # Web dashboard (localhost:3333)
lean-ctx cheatsheet            # Quick reference
lean-ctx discover              # Find uncompressed commands
lean-ctx doctor                # Diagnostics
lean-ctx update                # Self-update
lean-ctx wrapped               # Shareable savings report
lean-ctx benchmark run         # Real project benchmark
lean-ctx benchmark report      # Markdown report
Multi-Agent Launcher
lctx                              # Auto-detect agent, current dir
lctx --agent claude               # Launch Claude Code with lean-ctx
lctx --agent cursor               # Configure Cursor
lctx --agent gemini               # Launch Gemini CLI
lctx /path/to/project "prompt"    # Project + prompt
lctx --scan-only                  # Build project graph only

βš™οΈ Editor Configuration

lean-ctx setup handles this automatically. Manual config below is only needed for edge cases.

Cursor

~/.cursor/mcp.json:

{
  "mcpServers": {
    "lean-ctx": { "command": "lean-ctx" }
  }
}
GitHub Copilot

.github/copilot/mcp.json:

{
  "servers": {
    "lean-ctx": { "command": "lean-ctx" }
  }
}
Claude Code
claude mcp add lean-ctx lean-ctx
Windsurf

~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "lean-ctx": { "command": "lean-ctx" }
  }
}

If tools don't load, use the full path (e.g., /Users/you/.cargo/bin/lean-ctx). Windsurf spawns MCP servers with a minimal PATH.

Zed

~/.config/zed/settings.json:

{
  "context_servers": {
    "lean-ctx": {
      "source": "custom",
      "command": "lean-ctx",
      "args": [],
      "env": {}
    }
  }
}
OpenAI Codex

~/.codex/config.toml:

[mcp_servers.lean-ctx]
command = "lean-ctx"
args = []
Gemini CLI

~/.gemini/settings/mcp.json:

{
  "mcpServers": {
    "lean-ctx": { "command": "lean-ctx" }
  }
}
Pi Coding Agent
lean-ctx init --agent pi
# Or: pi install npm:pi-lean-ctx

Pi's bash, read, grep, find, and ls tools are automatically routed through lean-ctx. Supports 55+ file extensions with auto mode selection.

OpenCode

~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "lean-ctx": {
      "type": "local",
      "command": ["lean-ctx"],
      "enabled": true
    }
  }
}

πŸ† lean-ctx vs RTK

FeatureRTKlean-ctx
ArchitectureShell hook onlyShell hook + MCP server
Process modelSpawns per commandPersistent server (no EAGAIN)
CLI patterns~5090+
File readingSignatures only7 modes (full, map, signatures, diff, aggressive, entropy, lines)
File cachingβœ—βœ“ (re-reads β‰ˆ 13 tokens)
Signature engineRegex (4 langs)tree-sitter AST (18 langs)
Dependency mapsβœ—βœ“
Context checkpointsβœ—βœ“
Token countingEstimatedtiktoken-exact
Entropy analysisβœ—βœ“
Cost trackingβœ—βœ“ (USD estimates)
TDD modeβœ—βœ“ (8-25% extra)
Thinking reductionβœ—βœ“ (CRP v2)
Cross-session memoryβœ—βœ“ (CCP)
LITM positioningβœ—βœ“
Multi-agent sharingβœ—βœ“
Project knowledge storeβœ—βœ“
Web dashboardβœ—βœ“
Savings reportsβœ—βœ“ (wrapped)
Raw mode / bypassβœ“βœ“ (raw=true, --raw, lean-ctx-raw)
User-defined filtersTOML rulesTOML rules (priority over builtins)
Full output recoveryteeβœ“ (tee_mode: always/failures/never)
Truncation warningsβœ—βœ“ (transparent markers)
ANSI auto-stripβœ—βœ“ (pre-compression)
TelemetryDefault ON (PII)Zero. None. Ever.
Editor support3 editors23 editors/tools

πŸ” Privacy & Security

lean-ctx is privacy-first by design:

  • Zero telemetry β€” no data collection, no analytics, no phone-home, ever
  • Zero network requests β€” everything runs locally on your machine
  • No PII exposure β€” no hostnames, usernames, or project paths leave your system
  • Fully auditable β€” MIT-licensed, single Rust binary, no hidden dependencies

See SECURITY.md.

Note on VirusTotal: Rust binaries are frequently flagged by ML-based heuristic scanners. This is a known issue. Build from source with cargo install lean-ctx to verify.


πŸ—‘ Uninstall

lean-ctx init --global   # See what was added, then remove from shell profile
cargo uninstall lean-ctx # Remove binary
rm -rf ~/.lean-ctx       # Remove stats + config

🀝 Contributing

Contributions welcome! Open an issue or PR on GitHub.

Discord Β· 𝕏 / Twitter Β· Buy me a coffee β˜•


πŸ“„ License

MIT β€” see LICENSE.


Built with πŸ¦€ Rust Β· Made in Switzerland πŸ‡¨πŸ‡­

SEE ALSO

clihub4/5/2026LEAN-CTX(1)