95+ Befehlsmuster.
Transparente Kompression.
Der Shell Hook fängt CLI-Ausgaben ab, bevor deine KI sie sieht. Git-Diffs, npm-Installationen, Cargo-Builds, Docker-Logs - alles komprimiert auf die wesentlichen Informationen. Keine Konfiguration, keine Aliase zu lernen.
So funktioniert es.
Der Shell Hook umhüllt deine Befehle transparent. Die KI sieht komprimierte Ausgabe - du siehst keinen Unterschied.
Befehl
KI führt git status aus
Abfangen
lean-ctx fängt die Ausgabe ab
Komprimieren
Musterbasierte Reduktion
Ergebnis
KI sieht kompakte Ausgabe
Jedes Tool, das du bereits nutzt.
lean-ctx erkennt Ausgabemuster aller wichtigen Entwickler-Tools und komprimiert jedes mit massgeschneiderten Regeln.
Versionskontrolle
JavaScript / Node
Rust
Container & Orchestrierung
Python
System & Werkzeuge
Sieh den Unterschied.
On branch feature/auth
Your branch is ahead of 'origin/feature/auth'
by 3 commits.
(use "git push" to publish your local
commits)
Changes to be committed:
(use "git restore --staged <file>..."
to unstage)
new file: src/session.ts
modified: src/login.ts
modified: src/api.ts
Changes not staged for commit:
(use "git add <file>..." to update
what will be committed)
(use "git restore <file>..." to
discard changes in working directory)
modified: src/session.ts
Untracked files:
(use "git add <file>..." to include
in what will be committed)
src/session.test.ts feature/auth ↑3 staged: +session.ts ~login.ts ~api.ts unstaged: ~session.ts untracked: session.test.ts [534 tok saved (87%)]
Jeder Befehl, komprimiert.
npm warn deprecated inflight@1.0.6: This module is not supported... npm warn deprecated glob@7.2.3: Glob versions prior to v9... npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4... added 847 packages, and audited 848 packages in 12s 127 packages are looking for funding run `npm fund` for details found 0 vulnerabilities
✓ 847 packages 12s ⚠ 3 deprecated (inflight, glob, rimraf) 0 vulnerabilities [385 tok saved (92%)]
Compiling proc-macro2 v1.0.86
Compiling unicode-ident v1.0.12
Compiling syn v2.0.72
Compiling serde_derive v1.0.204
Compiling serde v1.0.204
Compiling tokio v1.39.2
Compiling lean-ctx v2.1.0
Finished `dev` profile [unoptimized
+ debuginfo] target(s) in 24.3s ✓ build dev 24.3s 7 crates compiled [280 tok saved (90%)]
Funktioniert unabhängig
Der Shell Hook arbeitet unabhängig vom Context Server. AI-Tools, die noch nicht konfiguriert wurden, profitieren ebenfalls von komprimierten Shell-Ausgaben. Der Hook fängt auf Shell-Ebene ab, sodass jedes Tool, das Befehle ausführt, spart.
Musterabdeckung auf einen Blick.
Docker & Container Environments
In containers, non-interactive shells skip ~/.bashrc. Set BASH_ENV to point at lean-ctx's dedicated env.sh file, which has no interactive-mode guard. For Claude Code, also set CLAUDE_ENV_FILE.
# In your Dockerfile:
ENV BASH_ENV="/root/.lean-ctx/env.sh"
ENV CLAUDE_ENV_FILE="/root/.lean-ctx/env.sh" lean-ctx includes self-healing: if the env.sh file is removed (e.g., by a container rebuild), lean-ctx init --global re-creates it automatically.
Vollständige Ausgabe nötig? Nutze den Raw-Modus.
Wenn du unkomprimierte Ausgabe brauchst, umgehe die Kompression mit einem einzigen Flag. Kein stiller Datenverlust - Kürzungen sind immer transparent.
# CLI flag - skip compression for one command
lean-ctx -c --raw kubectl get pods -o yaml
# Shell function - quick bypass
lean-ctx-raw gh pr view 42
# Kill-switch - disable ALL compression
LEAN_CTX_DISABLED=1 lean-ctx -c git log
# MCP parameter - for AI agents
ctx_shell(command="cat config.json", raw=true) Spare mit jedem Befehl.
Ein Setup-Befehl aktiviert den Shell Hook für deine Shell. Jeder AI-Befehl danach wird automatisch komprimiert.