Die Context Engineering Ebene
für AI-Coding.
lean-ctx ist ein Kompressionssystem mit drei unabhängigen Ebenen. Ein Context Server ersetzt die Dateizugriffe deiner KI durch AST-basierte komprimierte Versionen. Ein Shell Hook fängt 95+ CLI-Befehlsmuster ab. Und drei Kommunikationsprotokolle bringen der KI bei, effizienter zu antworten. Du installierst es einmal - alles andere passiert automatisch.
Wo sitzt lean-ctx genau?
lean-ctx greift auf zwei Ebenen ein: der Kontextebene (Dateizugriffe, Code-Suche, Shell-Befehle) und der Shell-Ebene (rohe CLI-Ausgabe). Beide komprimieren Daten, bevor sie das LLM erreichen. Die KI sieht dieselbe Information in einem Bruchteil der Tokens.
Without lean-ctx: You → AI Tool → reads file (full content) → LLM processes everything With lean-ctx: You → AI Tool → lean-ctx compresses → signal only → LLM: 60–99% less noise ├─ PathJail sandbox + size caps ├─ AST-aware compression ├─ Memory Runtime (knowledge + forgetting) ├─ Session cache (re-read ≈ 13 tok) └─ 10 read modes per file type
Du
Code ganz normal. Ändere nichts an deinem Workflow.
AI-Tool
Cursor, Claude Code, Copilot, Windsurf, …
lean-ctx
Komprimiert alles über Context Server & Shell Hook.
LLM
Sieht nur Signal. 60–90% weniger Tokens, gleiche Information.
Was machst DU eigentlich?
Fast nichts. lean-ctx arbeitet nach einer einmaligen Einrichtung unsichtbar. Du codest genauso weiter wie vorher.
Installieren
Ein einzelnes Rust-Binary. Keine Abhängigkeiten, keine Cloud, kein Account.
curl -fsSL leanctx.com/install.sh | sh Einrichten
Erkennt automatisch deine Shell und AI-Tools. Konfiguriert alles in Sekunden.
lean-ctx setup Es gibt keinen Schritt 3
Code normal weiter. Deine KI nutzt komprimierte Tools automatisch.
Tokens gespart: automatischDu vs. Die Maschine
| Was DU tust (einmalig) | Was AUTOMATISCH passiert |
|---|---|
| lean-ctx setup | KI nutzt ctx_read statt Read - bis zu 99% weniger Tokens (gecachte Wiederholungslesungen) |
KI nutzt ctx_shell statt Shell - 60–90% weniger Tokens | |
KI nutzt ctx_search statt Grep - 50–80% weniger Tokens | |
| Shell Hook komprimiert CLI-Ausgaben transparent | |
| Session-Cache merkt sich Dateien über Lesezugriffe hinweg (~13 Tokens für Wiederholungslesungen) | |
| lean-ctx gain (optional) | Sieh dein Lebenszeit-Einsparungs-Dashboard |
Vollständige Setup-Anleitung → Erste Schritte · Alle CLI-Befehle → CLI-Referenz
Reciprocal Rank Fusion (RRF) Cache Eviction
When the session cache is full, lean-ctx uses Reciprocal Rank Fusion to decide which entries to evict. Each signal (recency, frequency, size) is ranked independently, then fused into a single score - no arbitrary weight tuning required.
Formula: RRF(d) = Σ 1/(K + rank_i(d)) where K=60. This handles signal incomparability (seconds vs counts vs tokens) without needing tuned weights, unlike traditional weighted combinations.
Want to understand the architecture?
Explore the Context OS: the six-step pipeline, integration modes, agent matrix, Context Field Theory, and nine architectural pillars that make lean-ctx work.
Deep dive into Context OSSecurity Layer
lean-ctx enforces a defense-in-depth security model to prevent LLM prompt injection from accessing files outside the project:
- PathJail - All file operations are sandboxed to the project root. Symlink traversal,
../escapes, and absolute paths outside the jail are blocked at theresolve_pathchokepoint. - Bounded Shell Capture - Shell output is capped at 200KB with clear truncation markers. Prevents memory exhaustion from runaway commands.
- TOCTOU Prevention - File edits use same file handle for read-verify-write, eliminating time-of-check-to-time-of-use race conditions.
- Build Integrity - Compile-time integrity seed and hash verification detect tampered binaries. Checked automatically by
lean-ctx doctor.
Bereit, mit dem Sparen zu beginnen?
Ein Binary. Keine Cloud-Abhängigkeiten. Apache-2.0-Lizenz. In 60 Sekunden installiert und sofort Tokens sparen.