lean-ctx

LeanCTX is the Context Gateway for AI Systems. Select task-relevant context, apply supported controls, connect local knowledge and inspect recorded evidence. Op

What is lean-ctx?

LeanCTX is the Context Gateway for AI Systems. Select task-relevant context, apply supported controls, connect local knowledge and inspect recorded evidence. Open-source Engine: CLI, MCP, hooks and supported proxy paths.

Overview of lean-ctx

What it is

LeanCTX is a Context Gateway for AI Systems. It sits between AI tools and the information they read, selecting task-relevant context, applying supported access and content controls before delivery, and recording context operations and delivery evidence. The open-source LeanCTX Engine runs locally through CLI, MCP, hooks and proxy paths. The LeanCTX SDK embeds supported Engine capabilities in applications. The host retains control of the application, agent loop and model.

Key features

  • Select: 16 read modes (full, map, signatures, diff, lines:N-M, density:X, etc.), shell output compression for 85+ patterns, Tree-sitter AST for 27 languages, and source recovery via ctx_expand/ctx_retrieve.
  • Control: PathJail and roles constrain filesystem access; content filters can warn, redact or block on supported paths; context budgets bound input and tool output.
  • Learn: Session memory (CCP) persists task/facts/decisions across chats; knowledge graph with temporal facts; property graph for code relationships (imports, calls, exports, type_ref).
  • Prove: Context Manager browser dashboard with real-time token tracking; audit export; Context Proof (ctx_proof, ctx_verify) provides exportable audit trail and runtime-checked policy claims.
  • Shadow Mode: Simulated baseline estimating costs and token savings without changing the active workflow; reports cost, token savings, and CPAO deltas.

Use cases

  • 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 an application (LeanCTX SDK — stable interfaces and separate SDK/OEM terms).
  • Coding workflows with Claude Code, Cursor or Codex.

Getting started

See the repository README for installation and quick-start instructions.

License and pricing

Licensed under Apache-2.0. Open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/yvgudelean-ctx.svg)](https://yunodb.com/tools/yvgudelean-ctx?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/yvgudelean-ctx?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/yvgudelean-ctx.svg" alt="Featured on YunoDB" height="20"></a>