---
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.