ctx_read Core Tools Read file (cached, compressed). Cached re-reads can be ~13 tok when unchanged. Auto-selects optimal mode. Modes: full|map|signatures|diff|aggressive|entropy|task|reference|lines:N-M. fresh=true forces a disk re-read.
✓ When to Use
Reading source files with automatic compression mode selection. Default starting point for any file read.
✗ When Not to Use
When you need to read multiple files at once (use ctx_multi_read) or need raw grep results (use ctx_search).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fresh | boolean | No | Bypass cache and force a full re-read. Use when running as a subagent that may not have the parent's context. |
mode | string | No | Compression mode (default: full). Use 'map' for context-only files. For line ranges: 'lines:N-M' (e.g. 'lines:400-500'). |
path | string | Yes | Absolute file path to read |
start_line | integer | No | Read from this line number to end of file. Implies fresh=true (disk re-read) to avoid stale snippets. |
Examples
Auto-mode read (default)
ctx_read path="src/auth.ts" lean-ctx selects the best compression mode automatically based on file size, recency, and task context.
Force full read
ctx_read path="src/auth.ts" mode="full" Returns complete file content. Use when editing or when you need every detail.
Read specific line range
ctx_read path="src/auth.ts" mode="lines:42-80" Surgical read of lines 42-80 only. Minimal token cost.
CLI Equivalent
This tool is also available via the CLI:
lean-ctx read <path> [--mode <mode>] Related Tools
dd1d5ae70ed92652e9571da5737f2f98 ← Back to all tools