by yvgude
LeanCTX — Context Intelligence for AI systems.
# 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 Intelligence for AI systems. It has 3,821 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!
⚠️ 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.
LeanCTX — AI Value Gate for AI Coding Agents
LeanCTX — short for Lean Context — is an AI Value Gate and context engineering layer for AI coding agents. It runs locally alongside your coding agent, helping it read repositories, run development commands, and send focused context to the model: it understands the task, routes the right context, compresses what it sends, and tracks the cost and outcome of that work. Savings depend on the workload and enabled modes; the local savings ledger and Shadow Mode show the measured result against a comparable baseline. Zero config required. Local-first.
| Problem | With LeanCTX |
|---|---|
| Repeated file reads resend unchanged content | Cached re-reads return a compact deterministic reference |
| Raw development commands include repetitive noise | Command-specific compression preserves salient output |
| Every turn re-sends the whole history | Proxy compresses each request, prompt-cache-safe |
| Context resets every chat | Session memory persists across chats |
| No visibility into context usage | Real-time dashboard + budget control |
Control what your AI can see — and what it costs. LeanCTX is an AI Value Gate for coding agents: it understands tasks, routes and compresses context, remembers what it learns, and measures cost against accepted outcomes.
Token savings are the receipt. Intelligence is the product. Works with Cursor, Claude Code, Copilot, Windsurf, Codex, Gemini and 30+ other agents — no config needed.
lean-ctx setup command, no config changes neededModels are converging on commodity. The durable edge isn't which model you call — it's your context: what your agents read, what they remember, and what you can prove. And the layer that optimizes and owns that context can't come from the vendor that bills per token or keeps your memory in a black box — it has to sit on your side.
That's the shift behind "agent entities" that live in your chat and remember your company (Claude in Slack, ClickUp Brain): a context login, not a model login — you end up renting your own company knowledge back. LeanCTX is the opposite layer. It keeps the moat yours: local-first, portable (.ctxpkg), and model-agnostic — swap OpenAI, Anthropic or Gemini without losing context or cache. Own your context; don't rent it back.
LeanCTX treats context and AI spend as managed resources, not afterthoughts. One binary covers the capabilities that decide how well an AI agent performs:
Your AI agent reads files and runs commands. LeanCTX compresses both automatically.
Workload-specific token reduction on eligible context, with recovery paths and a local Shadow Mode baseline for measurement
File reads: 10 read modes (full, map, signatures, diff, lines:N-M, density:X, …) — cached re-reads cost ~13 tokens
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: 95+ shell-output patterns compress git, npm, cargo, docker, kubectl, terraform and more (270 passthrough rules)
Tree-sitter AST: structural understanding for 27 languages — not just text compression
Reversible by design (CCR): compression never discards content — pruned or truncated payloads move to a content-addressed store with a deterministic handle, so the model can pull the original bytes back on demand via ctx_expand, ctx_retrieve, an in-band marker, or GET /v1/references/{id}. Five recovery paths →
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): 4-layer verification engine with CI drift gates