The definition

What is
LeanCTX?

LeanCTX (short for Lean Context) is the context engineering layer for AI agents: it decides what agents read, compresses what they send, remembers what they learn, guards what they touch, and proves what they save — so what crosses the model boundary is intentional, compressed, and provable.

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.

The name

What does LeanCTX stand for?

Lean Context. The name describes the job: lean, precise context for AI agents instead of raw, noisy input.

  • LeanCTX: the brand and project name, used in prose and titles.
  • lean-ctx: the binary, the package and the CLI command.
  • Lean Context: what the name expands to, and the search term that finds us.

Not "Lean Cortex", a misspelling that appeared in early press coverage. If you are writing about the project, the press kit has copy-ready boilerplate.

The four jobs

Reads less. Remembers more. Proves it.

Four things change the moment LeanCTX becomes your context engineering layer.

Without LeanCTX, your agent… With LeanCTX… The receipt
reads everything reads what matters 60–90% less per read
forgets everything remembers across sessions re-reads cost ~13 tokens
touches anything touches only what's allowed PathJail · redaction · budgets
proves nothing proves every saving Ed25519-signed ledger
can't revisit what it saw replays any past state git-anchored, signed snapshots

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

Under the hood

Five subsystems, one binary.

Architecturally, LeanCTX is a Cognitive Context Layer: five subsystems run on every read, command and search. Compression is one of them — context engineering is the product.

01

Perceive

See what matters before you act.

02

Compress

Every token carries signal.

03

Remember

Continuity across sessions.

04

Route

The right context to the right model.

05

Govern

Safe, measured, enforced.

Key facts

The numbers behind the claim.

60–90%fewer tokens per read
~13tokens per cached re-read
10read modes
95+shell compression patterns
30+AI tools, auto-detected
26languages parsed via AST

All numbers are reproducible: lean-ctx benchmark report . measures them on your own repository, and every saving is recorded in an Ed25519-signed ledger.

FAQ

The name, the price, the product.

What is LeanCTX?

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.

What does LeanCTX stand for?

Lean Context. The name describes the job: lean, precise context for AI agents instead of raw, noisy input. LeanCTX is the brand and project name; lean-ctx is the binary, the package and the CLI command. It is not "Lean Cortex" — a misspelling that appeared in early coverage.

Is LeanCTX a compression tool?

No. Compression is one of five subsystems. LeanCTX is a context engineering layer: it decides what agents read, remembers what they learn, guards what they touch, and proves what they save in an Ed25519-signed ledger. Token savings are the receipt — context engineering is the product.

Is LeanCTX free?

Yes. Local use is free forever, enforced by a public CI gate that fails any commit putting a local capability behind a paywall. The core is open source (Apache-2.0). Paid plans add hosted sync (Pro) and a shared team plane (Team) on top.

See it decide on your own repo.

Install free, run lean-ctx setup, and watch the first measured gain in under ten minutes. Local use is free forever, enforced by CI.