Home/AI Agents/lean-ctx
lean-ctx logo

lean-ctx

Enrichment pending
yvgude/lean-ctx

Control what your AI can see. LeanCTX (Lean Context) is the context intelligence layer for AI agents — one local Rust binary that decides what they read, remembers what they learn, guards what they to

GraphCanon updated today · GitHub synced today

3.2k
Stars
295
Forks
4
Open issues
21
Watchers
today
Last push
Rust Apache-2.0Created Mar 23, 2026

Trust & integrity

Full report
Maintenance
Very active (0d since push)
As of today · Source: github_public_v1
Provenance
Not a fork · Personal account
As of today · Source: github_public_v1
Security (OSV)
No MCP manifest
As of today · Source: mcp_manifest

Public GitHub metadata and optional OSV dependency scans. Signals, not a guarantee. Trust methodology.

Overview

Control what your AI can see. LeanCTX (Lean Context) is the context intelligence layer for AI agents — one local Rust binary that decides what they read, remembers what they learn, guards what they touch, and proves what they save. 60–90% fewer tokens as the receipt. 76 MCP tools, 30+ agents, local-first.

Capability facts

Languages
rust

Source: github.language · Jul 11, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

LangChain integrationLangChain

Source: README excerpt (regex_v1, Jul 11, 2026)

Framework adapters included (LiteLLM, LangChain, Vercel AI SDK). → **[compress() cookbook](docs/guides/compress-sdk.md)**
Source link
Node.js runtimeNode.js

Source: README excerpt (regex_v1, Jul 11, 2026)

npm install -g lean-ctx-bin # Node.js
Source link
Python runtimePython

Source: README excerpt (regex_v1, Jul 11, 2026)

pip install lean-ctx-client # Python (imports as `leanctx`)
Source link

Tags

README

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 pi install npm:pi-lean-ctx # Pi Coding Agent


pip install lean-ctx-sdk

from lean_ctx import compress messages = compress(messages, model="claude-sonnet-4")


```ts
// npm install lean-ctx-sdk
import { compress } from "lean-ctx-sdk";
messages = await compress(messages, { model: "gpt-4o" });

Framework adapters included (LiteLLM, LangChain, Vercel AI SDK). → compress() cookbook

Thin /v1 contract clients — lean-ctx-client (npm · crates.io). Wrap the full /v1 tool, event and session API over the process boundary — never links the engine, so it stays stable as lean-ctx evolves.

pip install lean-ctx-client     # Python (imports as `leanctx`)
npm install lean-ctx-client     # TypeScript / Node
cargo add lean-ctx-client       # Rust

Start the server with lean-ctx serve, then point a client at it. → API reference


License

Apache License 2.0 — see LICENSE.

--- lean-ctx: ctx_compose bundles search+read+symbols in one call ---