loaditout.ai
SkillsPacksTrendingLeaderboardAPI DocsBlogSubmitRequestsCompareAgentsXPrivacyDisclaimer
{}loaditout.ai
Skills & MCPPacksBlog

lean-ctx

MCP Tool

yvgude/lean-ctx

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

Install

$ npx loaditout add yvgude/lean-ctx

Platform-specific configuration:

.claude/settings.json
{
  "mcpServers": {
    "lean-ctx": {
      "command": "npx",
      "args": [
        "-y",
        "lean-ctx"
      ]
    }
  }
}

Add the config above to .claude/settings.json under the mcpServers key.

About

lean-ctx

Hybrid Context Optimizer — Shell Hook + MCP Server. Single Rust binary, zero dependencies.

[](https://crates.io/crates/lean-ctx) [](rust/LICENSE)

Website · Install · Quick Start · CLI Reference · MCP Tools · vs RTK

---

lean-ctx reduces LLM token consumption by 89-99% through two complementary strategies in a single binary:

  1. Shell Hook — Transparently compresses CLI output before it reaches the LLM. Works without LLM cooperation.
  2. MCP Server — 8 tools for cached file reads, dependency maps, entropy analysis, and session metrics. Works with Cursor, GitHub Copilot, Claude Code, Windsurf, and any MCP-compatible editor.
Token Savings (Typical Cursor/Claude Code Session)

| Operation | Frequency | Standard | lean-ctx | Savings | |---|---|---|---|---| | File reads (cached) | 15x | 30,000 | 195 | -99% | | File reads (map mode) | 10x | 20,000 | 2,000 | -90% | | ls / find | 8x | 6,400 | 1,280 | -80% | | git status/log/diff | 10x | 8,000 | 2,400 | -70% | | grep / rg | 5x | 8,000 | 2,400 | -70% | | cargo/npm build | 5x | 5,000 | 1,000 | -80% | | Test runners | 4x | 10,000 | 1,000 | -90% | | curl (JSON) | 3x | 1,500 | 165 | -89% | | docker ps/build | 3x | 900 | 180 | -80% | | Total | | ~89,800 | ~10,620 | -88% |

> Estimates based on medium-sized TypeScript/Rust projects. MCP cache hits reduce re-reads to ~13 tokens each.

Installation
Cargo (recommended)
cargo install lean-ctx
Build from Source
git clone https://github.com/yvgude/lean-ctx.git
cd lean-ctx/rust
cargo build --release
cp target/release/lean-ctx ~/.local/bin/

> Add ~/.local/bin to your PATH if needed: > ```bash > echo 'export PATH="$HOME/.local/bin:$PA

Tags

agentic-codingaiclaude-codeclicompressioncontext-compressioncopilotcursordeveloper-toolsllmmcpopen-sourcerusttoken-optimizationtokens

Reviews

Loading reviews...

Quality Signals

1
Stars
0
Installs
Last updated25 days ago
Security: AREADME

Safety

Risk Levelmedium
Data Access
read
Network Accessnone

Details

Sourcegithub-crawl
Last commit3/23/2026
View on GitHub→

Embed Badge

[![Loaditout](https://loaditout.ai/api/badge/yvgude/lean-ctx)](https://loaditout.ai/skills/yvgude/lean-ctx)