lean-ctx

Featured

Local context tooling for AI agents. Use it to select, shape, reuse, recover, and inspect context before inference when reading files, running shell commands, searching code, or exploring directories.

AI & Automation 3,763 stars 344 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 91/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# LeanCTX — Local Context SDK for AI Agents LeanCTX is a local context layer for existing agents. It provides selectable file representations, focused search, controlled shell-output shaping, session continuity, and recovery to exact source when needed. ## Setup (run first) Before using lean-ctx, verify it is installed: ```bash which lean-ctx || bash scripts/install.sh ``` If the install script is not available locally, install manually: ```bash curl -fsSL https://raw.githubusercontent.com/yvgude/lean-ctx/main/skills/lean-ctx/scripts/install.sh | bash ``` After installation, run the one-command setup (installs shell hook + editor wiring + rules + skills): ```bash lean-ctx setup ``` lean-ctx supports two integration styles (auto-detected per agent): - **Hybrid (default where shell access exists)**: MCP for cached reads/search + shell hooks that compress command output. - **MCP (for IDE-extension agents without reliable shell hooks)**: cached reads + all tools via MCP. ## When to use lean-ctx Prefer the current shell's configured compression over nested wrappers. In agent shells, run commands normally unless the user explicitly asks for `lean-ctx -c <command>` or task setup/docs explicitly say the shell is not wrapped. Do not inspect env vars just to decide; users may forbid env access. Use `lean-ctx -c <command>` over running commands directly only when: - The command produces verbose output (build logs, git diffs, dependency trees, test results) - You are reading ...

Details

Author
yvgude
Repository
yvgude/lean-ctx
Created
5 months ago
Last Updated
today
Language
Rust
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category