LeanCTX is an open-source context gateway for AI systems, developed in Rust and published on GitHub with about 3,900 stars. It sits between your AI tools and the systems they read, selecting the task-relevant context, applying governance controls, and recording exactly what was delivered to the model.
As coding agents and AI apps read more of a company’s code, logs and documents, uncontrolled context becomes a cost, quality and security problem. LeanCTX addresses this with a local engine exposed through a CLI, an MCP server, hooks and proxy paths for tools like Claude Code, Cursor and Copilot. It enforces source-access policies, masks sensitive fields such as emails and customer IDs, keeps context within budgets, and maintains a knowledge layer of decisions and findings so the next session starts from what is already known. Every delivery is auditable, with source references and policy outcomes recorded as evidence. The project is actively developed with frequent updates through 2026.
The LeanCTX Engine is free and open source under the Apache 2.0 license, and context-only local use needs no hosted service. A commercial Enterprise offer adds organization identity, policy management and reporting under a license agreement, making the overall model freemium.
LeanCTX is for engineering teams and AI platform builders who need to control what their agents can see, prove what was delivered, and keep context costs down across many AI workflows.