lean-ctx

by yvgudeVerified

Control what your AI can see. LeanCTX (Lean Context) is the context intelligence layer for AI agents — one local Rust binary that decides what they read, remembers what they learn, guards what they touch, and proves what they save. 60–90% fewer tokens as the receipt. 76 MCP tools, 30+ agents, local-first.

3,633
Stars
331
Forks
Rust
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/yvgude/lean-ctx

Getting Started

Guides for using skills like lean-ctx.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

LeanCTX

The Context SDK for AI Agents. Give every agent a context system.

LeanCTX is a local context layer for existing AI agents. It selects, shapes, reuses, and recovers the project context an agent needs inside the agent loop you own. Your agent, model, tools, and task logic remain yours.

Your framework runs the agent. LeanCTX manages the context path routed through it.

LeanCTX supports three ways to integrate:

  • Attach — Available — add LeanCTX around a supported coding agent through CLI, MCP, or a local proxy.

  • Wrap — Preview — use the declared Python SDK v1 reference-wrapper path with an explicit lifecycle and evidence boundary.

  • Embed — Preview — integrate the Context Engine inside a custom host; the host keeps ownership of its full agent loop.

It is not an agent platform, a generic agent builder, a hosted execution service, or a marketplace.

What is available now

  • Local Runtime, CLI, MCP, and local proxy paths.

  • Context selection, structural views, compression, reuse, and recovery.

  • Supported local setup paths for Codex, Claude Code, and Cursor.

  • Local Receipt/evidence primitives and offline verification.

The Python SDK v1 and its declared OpenAI Agents reference-wrapper are Preview. Performance Profiles, first-class Context Kits, the Performance Benchmark product flow, AutoTune, public rankings, and organization-scale operation are Research. An implementation directory is not a product claim. Local agent-presence, handoff, and related coordination substrate are also Research; LeanCTX does not currently provide a public multi-agent orchestration contract.

The context lifecycle

Select → Shape → Reuse → Recover

Evidence is a separate proof discipline: a gain is valid only with a comparable baseline and treatment, a declared quality threshold, and visible methodology. A lower token count or calculated cost is not a successful outcome on its own.

Install

# Pick one installation method.
curl -fsSL https://leanctx.com/install.sh | sh
brew tap yvgude/lean-ctx && brew install lean-ctx
npm install -g lean-ctx-bin
cargo install lean-ctx

# Connect one supported agent, then verify the local installation.
lean-ctx wrap codex
lean-ctx doctor

Use lean-ctx unwrap codex to remove that integration, or lean-ctx uninstall --dry-run to review a full removal before it changes anything.

The context path

An agent does not always need the same representation of a project. LeanCTX provides local tools to inspect structure, public interfaces, relevant excerpts, exact lines, diffs, and full source. It also compresses eligible shell output, keeps recoverable references to source, and exposes local context state for the current task.

agent → LeanCTX context tools / shell hook → project and local tools
agent → optional local proxy                 → model provider

The proxy only records and transforms traffic it can observe. Its data must not be used to infer hidden prompts, retries, task quality, provider bills, or accepted business savings.

Use LeanCTX in your own agent

The current programmatic path is Python SDK v1 (Preview) through its declared OpenAI Agents reference-wrapper. It wraps that one declared agent lifecycle around the local Runtime; it does not choose a model, replace task logic, or turn an unobserved run into verified evidence.

pip install lean-ctx-python
from agents import Agent
from lean_ctx import LeanCTX

ctx = LeanCTX()
openai_agent = Agent(name="reviewer")
run = ctx.wrap(openai_agent).run("Review the payments module")
print(run.output)
print(run.receipt.verify())  # True only when Runtime evidence is sealed

See the Python SDK README for its declared adapter scope, compatibility, degradation behaviour, and evidence boundary.

Proof, not a percentage badge

Local observability can show context movement and compression deltas. A public performance or savings claim needs a matched workload, baseline, treatment, quality gate, methodology, and inspectable evidence. Until that path is complete, token changes remain diagnostic signals rather than outcome claims.

Supported setup paths

Codex, Claude Code, and Cursor are the current first-class local setup paths. Other clients must expose their actual capability and degradation state; MCP compatibility alone is not a support or evidence guarantee.

Documentation

Privacy and safety

LeanCTX is local-first. Telemetry is opt-in. Review the current configuration and path boundaries before enabling any integration, and use lean-ctx doctor to inspect local setup state.

Uninstall

lean-ctx uninstall --dry-run
lean-ctx uninstall

If you installed through a package manager, use its uninstall command for the binary after LeanCTX has removed its own local integration files.

License

Apache-2.0. See LICENSE.

Frequently Asked Questions

What is lean-ctx?

lean-ctx is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by yvgude. Control what your AI can see. LeanCTX (Lean Context) is the context intelligence layer for AI agents — one local Rust binary that decides what they read, remembers what they learn, guards what they touch, and proves what they save. 60–90% fewer tokens as the receipt. 76 MCP tools, 30+ agents, local-first. It has 3,633 GitHub stars.

Is lean-ctx safe to use?

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.

How do I install lean-ctx?

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).

What programming language is lean-ctx written in?

lean-ctx is primarily written in Rust. It is open-source under yvgude on GitHub, so you can review or fork the full source.

Are there alternatives to lean-ctx?

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.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details