PREFER lean-ctx MCP tools over native equivalents for token savings:
| PREFER | OVER | Why |
|---|---|---|
ctx_read(path, mode) |
Read / cat |
Cached, 10 read modes, re-reads ~13 tokens |
ctx_shell(command) |
Shell / bash |
Pattern compression for git/npm/cargo output |
ctx_search(pattern, path) |
Grep / rg |
Compact, token-efficient results |
ctx_tree(path, depth) |
ls / find |
Compact directory maps |
ctx_edit(path, old_string, new_string) |
Edit (when Read unavailable) |
Search-and-replace without native Read |
auto— auto-select optimal mode (recommended default)full— cached read (files you edit)map— deps + exports (context-only files)signatures— API surface onlydiff— changed lines after editsaggressive— maximum compression (context only)entropy— highlight high-entropy fragmentstask— IB-filtered (task relevant)reference— quote-friendly minimal excerptslines:N-M— specific range
- Editing the file? →
fullfirst, thendifffor re-reads - Need API surface only? →
maporsignatures - Large file, context only? →
entropyoraggressive - Specific lines? →
lines:N-M - Active task set? →
task - Unsure? →
auto(system selects optimal mode)
Anti-pattern: never use full for files you won't edit — use map or signatures.
Use native Edit/StrReplace if available. If Edit requires Read and Read is unavailable, use ctx_edit. Write, Delete, Glob → use normally. NEVER loop on Edit failures — switch to ctx_edit immediately.
ctx_overview(task)at session startctx_compresswhen context grows large