Intercept
Your agent calls ctx_read, ctx_shell, or ctx_search. LeanCTX intercepts the call before it reaches the filesystem.
كيف يعمل
LeanCTX هو طبقة هندسة السياق للوكلاء الذكاء الاصطناعي: ثنائي Rust صغير يقوم بتشغيل الحلقة نفسها في كل قراءة، أمر، وبحث. إنه يقرر ما يقرأه وكلاؤك، ويتذكر ما يتعلمونه عبر الجلسات، ويحمي ما يتفاعلون معه، ويثبت ما يحفظونه في سجل موقع التوقيع، ويعيد تشغيل ما رأوه. تتم تحليل القراءات بحثاً عن الهيكل عبر 26 لغة وتجريدها من الضوضاء، بحيث يكون ما يصل إلى النموذج مقصوداً ومضغوطاً وقابلاً للإثبات. تقوم بتثبيته مرة واحدة. كل شيء آخر تلقائي.
Every request flows through four stages. Your tools stay the same — LeanCTX intercepts silently between your AI tool and the LLM.
Your agent calls ctx_read, ctx_shell, or ctx_search. LeanCTX intercepts the call before it reaches the filesystem.
Tree-sitter parses the AST. Shell patterns match the command. The content-addressed cache checks for re-reads.
Only the signal reaches the model. Signatures, errors, relevant matches — structured, deduplicated, compressed.
One Rust binary. Zero config. Your agent gets better context without knowing LeanCTX exists.
When your agent reads a file, LeanCTX returns only the structural signature — function signatures, type definitions, and key logic. The full file never enters context.
Explore read modesA raw git diff produces hundreds of lines. LeanCTX pattern-matches 95+ commands and returns only the meaningful delta — file names, hunks, and error lines.
See all patternsBefore any file read or shell command executes, LeanCTX validates the path against PathJail, checks the shell allowlist, and redacts detected secrets. lean-ctx doctor shows the full posture.
Security docsThe practical details behind the compression layer.
No. LeanCTX only intercepts reads and compresses the output. It never modifies source files.
LeanCTX supports 27 languages via tree-sitter AST analysis, preserving code structure while removing redundant syntax and noise.
Yes. Use path-based rules in config.toml to exclude files from compression or choose a specific read mode for them.
LeanCTX degrades gracefully: reads fall through to native tools, so your agent can keep working without the compression layer.
Install LeanCTX and watch your agent's context usage drop.
curl -fsSL https://leanctx.com/install.sh | sh Cookie preferences
We use analytics to understand how our site is used. You choose what's allowed — no tracking runs until you decide.
Essential
Site functionality, security, preferences
Analytics
Pageviews & usage patterns · PostHog EU (Frankfurt) · No cross-site tracking
Read our Privacy Policy for full details. You can change your preferences anytime.