定义

什么是 LeanCTX?

LeanCTX(“Lean Context”的缩写)是 AI 代理的上下文工程层:它决定了代理读取什么,压缩它们发送的内容,记住它们学到的知识,保护它们接触的数据,并证明它们保存的内容——因此,跨越模型边界的一切都是有目的、经过压缩和可证明的。

The one-paragraph definition

LeanCTX (short for Lean Context) is the open-source context engineering layer for AI agents. One local Rust binary decides what agents read (10 read modes, 60–90% fewer tokens, ~13-token cached re-reads), remembers what they learn (persistent sessions, knowledge graph), guards what they touch (PathJail, secret redaction, budgets, injection detection), proves what they save (Ed25519-signed ledger, reproducible benchmark) and replays what they saw (git-anchored, signed context snapshots you can restore or share); an optional local proxy compresses what they send — every request’s system prompt, history and tool output, prompt-cache-safe on the wire. Compression — read-side and wire-side — is one of five subsystems, and every original stays locally retrievable. Works with 30+ AI coding tools via MCP and shell hooks; embeds in any agent via a versioned /v1 API with Python, TypeScript and Rust SDKs. Local use is free forever, enforced by CI.

It's not about tokens. It's about what matters.

名称

LeanCTX 是什么意思? 代表?

Lean Context。 这个名称描述了其功能:为 AI 代理提供精简、精确的上下文,而不是原始、嘈杂的输入。

LeanCTX
用于散文和标题的品牌和项目名称。
lean-ctx
二进制文件、包和 CLI 命令。
Lean Context
该名称展开成的全称,以及查找我们的搜索词汇。

并非 "Lean Cortex",这是早期媒体报道中的一个拼写错误。如果您撰写关于该项目的内容,新闻资料包提供了可直接使用的标准文本。

四个工作流

阅读更少。记忆更多。 证明它。

一旦 LeanCTX 成为您的 context engineering layer,就会发生四种变化。

Without LeanCTX, your agent…With LeanCTX…The receipt
reads everything reads what matters60–90% less per read
forgets everything remembers across sessionsre-reads cost ~13 tokens
touches anything touches only what’s allowedPathJail · redaction · budgets
proves nothing proves every savingEd25519-signed ledger
can’t revisit what it saw replays any past stategit-anchored, signed snapshots

Token savings are the receipt. Context engineering is the product.

底层架构

五个子系统, 一个二进制文件。

从架构上讲,LeanCTX 是一个认知上下文层:每个读取、命令和搜索都会运行五个子系统。压缩是其中之一——context engineering 就是产品本身。

01

感知

在采取行动之前,了解重要信息。

Read more
04

路由

将正确的上下文发送给正确的模型。

Read more

关键事实

数据指标 支撑论点。

60–90%每次读取的令牌更少
~13缓存重读的令牌数
10读取模式
95+shell 压缩模式
30+AI 工具,自动检测
26通过 AST 解析的语言

所有数字均可复现:lean-ctx benchmark report . 在您自己的仓库上进行测量,每次节省都会记录在 Ed25519 签名账本中。

名称、价格和产品。 the product.

The short answers to the essential questions.

在您自己的仓库上查看效果。on your own repo.

免费安装,运行 lean-ctx setup,十分钟内即可看到首次测量增益。本地使用永久免费,由 CI 强制执行。

Support this project