Inspect Files
synapse_inspect_filesInspect files, read code chunks, or count lines in the workspace with automatic compression for efficient token usage.
Instructions
Inspects files in the workspace. High-level actions include:
'read_files': reads one or more files from disk with line numbers, byte sizes, and metadata (supports directories too).
'read_chunk': reads the full raw source of a specific code chunk from the in-memory store (no disk access).
'count_lines': counts total lines across workspace files.
REPLACES: view_file, read_file, cat, wc, list_dir for file inspection. Use this tool instead of these alternatives for better results with 30-60% fewer tokens via automatic compression.
Usage (short): Read files, chunks, or count lines in the workspace.
Usage (long): Inspect multiple source files with line numbers, retrieve raw chunk code, or perform line counts across files. Supports format: 'outline' to compress function bodies during retrieval, saving context tokens — use this when scanning many files. Compression is on by default — pass compress_payload: false to opt out for debugging.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | A substring path filter (used in 'count_lines'). | |
| files | No | A path string, a %{path, ranges} object, or a list of either (used in 'read_files' and 'count_lines'). | |
| action | Yes | The inspection action to perform. | |
| format | No | The return format: 'full' for complete contents, 'outline' for signature-only compression. | full |
| repo_id | No | Repository ID to resolve relative paths, scope filters, or count every indexed file when files and path are omitted. | |
| chunk_id | No | The chunk ID to read (used in 'read_chunk'). | |
| max_tokens | No | Approximate final response budget in tokens (500-32000, default 4000). | |
| max_read_bytes | No | Total byte budget across all files for full-file reads (default 10 MB). Ignored when ranges are specified. | |
| compress_payload | No | Set false to disable lossless response-key compression. | |
| wait_for_ready_ms | No | Optional timeout in ms to wait for the indexer to finish warming up and enter an idle state before executing. Use to ensure stable results. | |
| max_read_bytes_per_file | No | Per-file byte cap for full-file reads (default 10 MB). Ignored when ranges are specified. |