lean-ctx
SolidContext Runtime for AI Agents — 76 MCP tools, 10 read modes, 95+ shell patterns, tree-sitter AST for 18 languages. Compresses LLM context by up to 99%. Use when reading files, running shell commands, searching code, or exploring directories. Auto-installs if not present.
AI & Automation 2,646 stars
267 forks Updated today Apache-2.0
Install
Quality Score: 91/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# lean-ctx — Context Runtime for AI Agents
## Setup
```bash
which lean-ctx || curl -fsSL https://raw.githubusercontent.com/yvgude/lean-ctx/main/skills/lean-ctx/scripts/install.sh | bash
lean-ctx setup
```
## Core Tools (10 always visible)
| Tool | Purpose |
|------|---------|
| `ctx_read(path, mode)` | Read file with compression and caching |
| `ctx_search(pattern, path)` | Search code with compressed results |
| `ctx_shell(command)` | Run shell with compressed output |
| `ctx_tree(path, depth)` | Directory listing |
| `ctx_edit(path, old, new)` | Search-and-replace editing |
| `ctx_session(action)` | Session state and persistence |
| `ctx_knowledge(action)` | Project knowledge across sessions |
| `ctx_overview(task)` | Task-relevant project map |
| `ctx_graph(action)` | Code relationships and impact |
| `ctx_call(name, args)` | Invoke any tool by name |
## Shell Hook (use instead of raw exec)
```bash
lean-ctx -c "git status"
lean-ctx -c "cargo test"
lean-ctx -c "npm install"
lean-ctx ls src/
```
## ctx_read Modes
| Mode | When |
|------|------|
| `full` | Files you will edit |
| `map` | Context-only (deps + exports) |
| `signatures` | API surface only |
| `diff` | After edits (changed lines) |
| `aggressive` | Large files, syntax-stripped |
| `entropy` | Shannon filtering |
| `task` | Task-relevant lines |
| `lines:N-M` | Specific range |
| `auto` | System selects optimal |
Re-reads cost ~13 tokens. fresh=true bypasses cache.
## File Editing
Use native Edit/StrRep...
Details
- Author
- yvgude
- Repository
- yvgude/lean-ctx
- Created
- 2 months ago
- Last Updated
- today
- Language
- Rust
- License
- Apache-2.0
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
lean-context
Use to keep context lean. Read only what you need. Compress aggressively.
0 Updated yesterday
liujiarui0918 AI & Automation Listed
context-engineering
Master the four operations of context engineering — Write, Select, Compress, Isolate. Manage token budgets, compaction strategies, and context partitioning to keep AI sessions sharp and efficient.
2,296 Updated 3 days ago
rohitg00