# lean-ctx — Token Optimization
lean-ctx is configured as an MCP server. Always use lean-ctx MCP tools instead of built-in tools:
- Read files → `ctx_read(path, mode)` instead of built-in Read
- Shell commands → `ctx_shell(command)` instead of built-in Shell
- Search code → `ctx_search(pattern, path)` instead of built-in Grep
- List directories → `ctx_tree(path, depth)` instead of ls/find
ctx_read modes: full (cached, for files you edit), map (deps+API, context-only), signatures, diff, aggressive, entropy.
For shell commands without MCP equivalents, prefix with `lean-ctx -c`:
- `lean-ctx -c git status` instead of `git status`
- `lean-ctx -c cargo test` instead of `cargo test`
- `lean-ctx -c npm install` instead of `npm install`
Write, StrReplace, Delete have no lean-ctx equivalent — use them normally.