এটি কীভাবে কাজ করে

Context Engineering লেয়ার
AI কোডিংয়ের জন্য।

lean-ctx হলো তিনটি স্বতন্ত্র লেয়ার সহ একটি কম্প্রেশন সিস্টেম। একটি কনটেক্সট সার্ভার আপনার AI-এর ফাইল রিডকে AST-সচেতন কম্প্রেসড সংস্করণ দিয়ে প্রতিস্থাপন করে। একটি শেল হুক ৯০+ CLI কমান্ড প্যাটার্ন ইন্টারসেপ্ট করে। এবং তিনটি কমিউনিকেশন প্রোটোকল AI-কে আরও দক্ষভাবে প্রতিক্রিয়া দিতে শেখায়। আপনি একবার ইনস্টল করুন - বাকি সবকিছু স্বয়ংক্রিয়।

ডেটা ফ্লো

lean-ctx কোথায় বসে?

lean-ctx দুটি স্তরে ইন্টারসেপ্ট করে: কনটেক্সট লেয়ার (ফাইল রিড, কোড সার্চ, শেল কমান্ড) এবং শেল লেয়ার (কাঁচা CLI আউটপুট)। উভয়ই LLM-এ পৌঁছানোর আগে ডেটা কম্প্রেস করে। AI একই তথ্য দেখে অনেক কম token-এ।

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

শুধু সিগন্যাল দেখে। ৬০-৯০% কম token, একই তথ্য।

দুটি কমান্ড। ব্যস।

আপনি আপনি আসলে কী করেন?

প্রায় কিছুই নয়। একবার সেটআপের পর lean-ctx অদৃশ্যভাবে কাজ করে। আপনি আগের মতোই কোডিং চালিয়ে যান।

01

ইনস্টল

একক Rust বাইনারি। কোনো ডিপেন্ডেন্সি নেই, কোনো ক্লাউড নেই, কোনো অ্যাকাউন্ট নেই।

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

সেটআপ

স্বয়ংক্রিয়ভাবে আপনার শেল এবং AI টুল শনাক্ত করে। সেকেন্ডে সবকিছু কনফিগার করে।

lean-ctx setup
03

কোনো ধাপ ৩ নেই

স্বাভাবিকভাবে কোড করুন। আপনার AI স্বয়ংক্রিয়ভাবে কম্প্রেসড টুল ব্যবহার করে।

সাশ্রয়কৃত token: স্বয়ংক্রিয়ভাবে

আপনি বনাম মেশিন

আপনি যা করেন (একবার) যা স্বয়ংক্রিয়ভাবে ঘটে
lean-ctx setup AI Read-এর পরিবর্তে ctx_read ব্যবহার করে - ৯৯% পর্যন্ত কম token (ক্যাশড পুনঃপড়া)
AI Shell-এর পরিবর্তে ctx_shell ব্যবহার করে - ৬০-৯০% কম token
AI Grep-এর পরিবর্তে ctx_search ব্যবহার করে - ৫০-৮০% কম token
Shell hook স্বচ্ছভাবে CLI আউটপুট কম্প্রেস করে
সেশন cache রিড জুড়ে ফাইল মনে রাখে (পুনঃপড়ায় ~13 token)
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.
শুরু করুন

শুরু করতে প্রস্তুত সাশ্রয় করতে?

একটি বাইনারি। শূন্য ক্লাউড নির্ভরতা। Apache-2.0 লাইসেন্সযুক্ত। ৬০ সেকেন্ডে ইনস্টল করুন এবং এখনই token সাশ্রয় শুরু করুন।