Read
Use these tools instead of shell cat, head, tail, cut, ls, or stat.
read_file
Section titled “read_file”Pass path, or paths for a batch. The same range applies to every file in a batch. A 300-line cap applies to batch reads.
| Need | Parameters |
|---|---|
| Full file | path |
| Absolute line range | start_line, end_line (inclusive, not a count) |
| Count from a line | start_line, max_lines (omit end_line) |
| First N lines | max_lines, mode omitted or all |
| Head or tail | mode: head or tail, plus max_lines |
| Log tail | mode:"tail", max_lines:40. Each line is cut at 300 characters. max_line_length overrides. 0 disables the cut. |
| Binary | encoding:"base64" |
content_hash is the full file, including on range and head/tail reads. Batch reads omit the top-level hash and put content_hash on each files[] entry.
detail is summary, normal (default), or full. Batch summary omits file bodies and keeps path and hash.
Do not use a tail cut when you need exact text for edit_file.
Listing
Section titled “Listing”list_directory output_format: compact (default), json, tree, sizes.
directory_tree is the compact tree. Defaults: gitignore on, max_depth=2, max_nodes=500. Structured output includes truncated and hidden_count.
get_file_info returns size, permissions, and dates. Pass paths for a batch. Use it after a write to confirm the host file, not only the write response.
Copy paths from list_directory or read_file. Do not retype them. Windows is case-insensitive, but a later tool may keep the spelling you passed.