यह कैसे काम करता है

हर बाइट मायने रखता है।
एक भी बर्बाद न करें।

lean-ctx तीन स्वतंत्र स्तरों वाला एक संपीड़न सिस्टम है। एक कॉन्टेक्स्ट सर्वर आपके AI की फ़ाइल रीड को AST-जागरूक संस्करणों से बदल देता है। एक शेल हुक 95+ CLI कमांड पैटर्न इंटरसेप्ट करता है। और तीन संचार प्रोटोकॉल AI को अधिक कुशलता से जवाब देना सिखाते हैं। एक बार इंस्टॉल करें - बाकी सब स्वचालित।

डेटा फ़्लो

lean-ctx कहाँ बैठता है?

lean-ctx दो स्तरों पर इंटरसेप्ट करता है: कॉन्टेक्स्ट लेयर (फ़ाइल रीड, कोड सर्च, शेल कमांड) और शेल लेयर (कच्चा CLI आउटपुट)। दोनों LLM तक पहुँचने से पहले डेटा संपीड़ित करते हैं। AI वही जानकारी टोकन के एक अंश में देखता है।

data flow - before vs. after
Without lean-ctx:

YouAI Tool  →  reads file  (full content)LLM processes everything

With lean-ctx:

YouAI Toollean-ctx compresses  →  signal onlyLLM: 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

आप

सामान्य रूप से कोड करें। अपने वर्कफ़्लो में कुछ न बदलें।

AI टूल

Cursor, Claude Code, Copilot, Windsurf, आदि

lean-ctx

Context Server और Shell Hook के ज़रिए सब कुछ संपीड़ित करता है।

LLM

केवल सिग्नल देखता है। 60–90% कम टोकन, वही जानकारी।

दो कमांड। बस।

क्या आप वास्तव में करते हैं?

लगभग कुछ नहीं। एक बार सेटअप के बाद lean-ctx अदृश्य रूप से काम करता है। आप पहले जैसा ही कोड करते रहते हैं।

01

इंस्टॉल करें

एकल Rust बाइनरी। कोई निर्भरता नहीं, कोई क्लाउड नहीं, कोई खाता नहीं।

curl -fsSL leanctx.com/install.sh | sh
02

सेटअप

आपका शेल और AI टूल्स अपने आप पहचानता है। सेकंडों में सब कॉन्फ़िगर करता है।

lean-ctx setup
03

कोई चरण 3 नहीं

सामान्य रूप से कोड करें। आपका AI संपीड़ित टूल स्वचालित रूप से इस्तेमाल करता है।

बचे टोकन: स्वचालित रूप से

आप बनाम मशीन

आप क्या करते हैं (एक बार) स्वचालित रूप से क्या होता है
lean-ctx setup AI Read की जगह ctx_read इस्तेमाल करता है - कैश्ड री-रीड पर 99% तक कम टोकन
AI Shell की जगह ctx_shell इस्तेमाल करता है - 60–90% कम टोकन
AI Grep की जगह ctx_search इस्तेमाल करता है - 50–80% कम टोकन
शेल हुक CLI आउटपुट पारदर्शी रूप से संपीड़ित करता है
सेशन कैश रीड के बीच फ़ाइलें याद रखता है (री-रीड ~13 टोकन)
lean-ctx gain (वैकल्पिक) अपना लाइफ़टाइम बचत डैशबोर्ड देखें

पूरा सेटअप गाइड → शुरू करें  ·  सभी CLI कमांड → CLI संदर्भ

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 OS

Security 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 the resolve_path chokepoint.
  • 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.
शुरू करें

अपना कॉन्टेक्स्ट इंजीनियर करें।

lean-ctx इंस्टॉल करें और 60 सेकंड में बचत मापें।