lean-ctx 3.5.6

Context Runtime for AI Agents with CCP. 57 MCP tools, 10 read modes, 95+ compression patterns, cross-session memory (CCP), persistent AI knowledge with temporal facts + contradiction detection, multi-agent context sharing + diaries, LITM-aware positioning, AAAK compact format, adaptive compression with Thompson Sampling bandits. Supports 24 AI tools. Reduces LLM token consumption by up to 99%.
Documentation
---
description: "lean-ctx cli-redirect: prefer lean-ctx CLI commands for token savings"
alwaysApply: true
---

# lean-ctx — Context Engineering Layer
<!-- lean-ctx-rules-cli-v1 -->

## Mode: CLI-Redirect (no MCP schema overhead)

Prefer lean-ctx CLI commands over MCP tools:

| USE (via Shell/Bash) | INSTEAD OF (MCP) | Why |
|---------------------|-------------------|-----|
| `lean-ctx read <path> [-m mode]` | `ctx_read` | No MCP schema overhead, same caching |
| `lean-ctx -c "<cmd>"` | `ctx_shell` | Pattern compression (95+ patterns) |
| `lean-ctx grep <pattern> [path]` | `ctx_search` | Compact results via CLI |
| `lean-ctx ls [path]` | `ctx_tree` | Directory maps via CLI |

## Read modes

auto | full | map | signatures | diff | aggressive | entropy | task | reference | lines:N-M

## File editing

Use native Edit/StrReplace. Write/Delete/Glob → use normally.