by yvgude
LeanCTX — Context Gateway for AI Systems. Control what your AI can see. Open-source Engine for context selection, supported controls, and evidence.
# Add to your Claude Code skills
git clone https://github.com/yvgude/lean-ctxLast scanned: 5/2/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-02T06:11:19.331Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}See how lean-ctx compares with popular alternatives.
lean-ctx is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by yvgude. LeanCTX — Context Gateway for AI Systems. Control what your AI can see. Open-source Engine for context selection, supported controls, and evidence. It has 3,880 GitHub stars.
Yes. lean-ctx passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/yvgude/lean-ctx" and add it to your Claude Code skills directory (see the Installation section above).
lean-ctx is primarily written in Rust. It is open-source under yvgude on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh lean-ctx against similar tools.
No comments yet. Be the first to share your thoughts!
30 days in the Featured rail · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
Context Gateway for AI Systems.
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.
Files · repositories · tool results · configured providers
│
▼
LeanCTX Context Gateway
Select → Control → 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
lean-ctx setup.Context Intelligence is how LeanCTX selects and prepares information for a task. These mechanisms support the Gateway's Select → Control → Prove flow.
For supported read and shell paths, LeanCTX can select compact representations of the files and command output your AI agent uses.
Workload-specific token reduction on eligible context, with recovery paths and a local Shadow Mode baseline for measurement
File reads: 16 read modes (full, map, signatures, diff, lines:N-M, density:X, …) — eligible cached re-reads return a compact reference instead of repeating content
Target density (density:0.4): SDE-style budget compression — keeps the highest-entropy lines until ~40% of the original tokens remain, deterministic
JIT disclosure: signatures carries line spans and points at lines:N-M for targeted expansion — outline first, bodies on demand
Shell output: 85+ shell-output patterns compress git, npm, cargo, docker, kubectl, terraform and more (250+ passthrough rules)
Tree-sitter AST: structural understanding for 27 languages — not just text compression
Source recovery (CCR): supported compact views retain source or archive references for expansion through ctx_expand, ctx_retrieve or the reference API. Recovery depends on permissions, retention and the source remaining available. Read modes and detail →
Not every task or file needs the same depth. LeanCTX classifies the task, then sends the signal rather than the noise.
ModePredictor: learns the optimal read mode per file type from past sessionsIntentEngine: classifies query complexity so simple lookups stay cheapRelevant code, sessions, and connected sources become focused context instead of a larger prompt.
.ctxpkg package and move it across machines or models, instead of locking it in a vendor's black boxPerformance is the cost of a useful result, not just speed. LeanCTX records costs and outcomes locally; CPAO (Cost per Accepted Outcome) is the north-star metric for comparing useful AI work.
ctx_proof, ctx_verify): exportable audit trail (verifier, SLO, pipeline and provenance records) plus runtime-checked policy claims (PathJail per touched file, budget)Shadow Mode estimates what the same work would have cost without LeanCTX, without changing the active workflow. The baseline is simulated from the uncompressed token counts and the same outcome signals, not a second measured run, so its reports estimate cost, tokens