Your cheat sheet for daily use. For detailed explanations, follow the links to each section's dedicated page.
Read Mode Decision Tree
Which ctx_read mode should the AI use?
| Situation | Mode | Typical savings |
|---|---|---|
| File you'll edit | full | Re-reads: ~99% |
| Context only (deps, structure) | map | ~93% |
| API surface (fn/class signatures) | signatures | ~95% |
| After editing a file | diff | ~98% |
| Browse a large file | aggressive | ~85% |
| Very large file, few relevant lines | entropy | ~90% |
| Task-relevant lines only | task | ~77% |
| API docs and reference lookup | reference | ~80-95% |
| Specific line range (surgical) | lines:N-M | ~90-99% |
| Automatic (default - best mode per file) | auto | ~70-99% |
Context Tools (what the AI uses)
These are called by the AI automatically - you don't type them.
| Tool | Purpose | Savings |
|---|---|---|
ctx_read | Read file with compression + caching | up to 99% |
ctx_shell | Execute command with output compression | 60–95% |
ctx_search | Code search with compact results | 50–80% |
ctx_session | Cross-chat session memory | 99% cold-start |
ctx_graph | Dependency graph visualization | - |
ctx_smells | Code smell detection with graph scoring | - |
CLI Commands (what you type)
Essential
| Command | What it does |
|---|---|
lean-ctx setup | One-time setup - detects shell + AI tools, installs everything |
lean-ctx gain | Savings dashboard (--live, --graph, --daily) |
lean-ctx doctor | Diagnose installation issues (11 checks) |
lean-ctx dashboard | Web dashboard with charts (localhost:3333) |
lean-ctx knowledge <action> | Project knowledge: remember, recall, search, export, import, remove, status, health |
lean-ctx benchmark run [path] | Real token savings measurement |