██╗ ███████╗ █████╗ ███╗ ██╗ ██████╗████████╗██╗ ██╗ ██║ ██╔════╝██╔══██╗████╗ ██║ ██╔════╝╚══██╔══╝╚██╗██╔╝ ██║ █████╗ ███████║██╔██╗ ██║ ██║ ██║ ╚███╔╝ ██║ ██╔══╝ ██╔══██║██║╚██╗██║ ██║ ██║ ██╔██╗ ███████╗███████╗██║ ██║██║ ╚████║ ╚██████╗ ██║ ██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝## LeanCTX **Context Gateway for AI Systems.** ### **Control what your AI can see.** LeanCTX sits between AI tools and the information they read. It selects task-relevant context, applies supported access and content controls before delivery, and records the context operations and delivery evidence it can observe. Your application, agent loop and model stay yours. The open-source **LeanCTX Engine** runs locally through CLI, MCP, hooks and proxy paths. The **LeanCTX SDK** embeds supported Engine capabilities in your application. ---
Website · Docs · Install · Scenarios · Demo · Benchmarks · Cookbook · Security · Changelog
Files · repositories · tool results · configured providers
│
▼
LeanCTX Context Gateway
Select · Control · Learn · Prove
│
▼
Your AI application / agent
│
▼
Your model
For coding workflows, start with Claude Code, Cursor or Codex. The installation matrix distinguishes first-class paths from other compatibility references.
| Your work | Start here |
|---|---|
| Improve the context path of existing AI tools | Community setup |
| Apply shared context controls across an organization | Enterprise — licensed controls and deployment scope |
| Build context control into your application | LeanCTX SDK — stable interfaces and separate SDK/OEM terms |
What is LeanCTX? · Where LeanCTX fits · Architecture
See it in action:
Read + Shell Map-mode reads + compressed CLI output |
Gain (terminal) Token usage + estimated cost differences |
Benchmark measurement Measure compression by language + mode |
All GIFs are generated from reproducible VHS tapes in demo/.
lean-ctx setup.Find LeanCTX useful? Give it a star — it helps others find the Context Gateway for AI systems.
The Engine puts Select, Control, Learn and Prove into the context paths of your existing AI tools. Your host keeps control of the task, agent loop and model.
Search and structural views help an agent find relevant information before reading entire files. Supported read and shell paths can return focused views of files and command output, with references for recovering detail.
full, map, signatures, diff, lines:N-M, density:X, …) — eligible cached re-reads return a compact reference instead of repeating contentdensity:0.4): SDE-style budget compression — keeps the highest-entropy lines until ~40% of the original tokens remain, deterministicsignatures carries line spans and points at lines:N-M for targeted expansion — outline first, bodies on demandctx_expand or the reference API. Recovery depends on permissions, retention and the source remaining available. Read modes and detail →Review the security policy for defaults, supported controls and coverage limits. A filesystem boundary is not an operating-system sandbox.
Keep useful task records and discover relationships between code and local knowledge. Learning here means context continuity; it does not train your model.
.ctxpkg export is described under Research below.Inspect source references, recorded policy decisions and delivery evidence from
supported paths. lean-ctx inspect explains observed context operations. A
context-only integration records its prepared result; it cannot prove a later
model call made by the host.
lean-ctx cockpit): local browser view with token tracking, compression stats, spend and recorded callsctx_proof, ctx_verify): exportable audit trail (verifier, SLO, pipeline and provenance records) plus runtime-checked policy claims (PathJail per touched file, budget)Context controls and evidence come first. Usage estimates and calculated costs help you assess
| 日期 | 榜单 | 排名 | 周期新增 | 总 STAR |
|---|