read_file
Read files with lossless deduplication: first read returns full content, later reads return diffs for changes or reuse markers for unchanged views, with optional symbol and line-range reads.
Instructions
Read a text file through the context ledger. The FIRST read of a file/view (or the first after a context compaction) returns full content. A later read of an UNCHANGED view returns a short "reuse what you have" marker. A later read of a CHANGED view returns a unified DIFF to apply to the copy you already have. Optionally read just one symbol (function/class by name) or a line range instead of the whole file. All dedup is lossless: it only diffs/withholds content it can prove you still have. Every read is metered (see context_stats) and attested in the signed context receipt. Pass force_full:true for the whole content regardless.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the file to read (absolute, or relative to the server cwd). | |
| lines | No | Return only this 1-based inclusive line range, e.g. "40-90". | |
| symbol | No | Return only this function/class/type by name (heuristic brace/indent extraction). | |
| force_full | No | Return full content even when a diff or unchanged-marker would suffice. |