senkani_read
Read
Savings 50–99%
Compressed file reads with session caching, outline-by-default, and secret redaction. The single most-called tool in a typical session.
Signature
Behavior
Returns an outline (symbols + line numbers) by default — ~99% smaller than the raw file. Pass `full: true` for the complete content. Every read passes through ANSI stripping, blank-line collapse, SecretDetector, and the ReadCache keyed on (path, mtime).
Inputs
Output
Outline mode: list of `{{name, kind, line_start, line_end, container}}` entries. Full mode: the file content with secrets redacted and ANSI stripped.
Example
// outline mode (default) {"tool": "senkani_read", "args": {"path": "/repo/src/OrderRepo.ts"}} // returns ~50 tokens: [ {"name": "OrderRepository", "kind": "class", "line_start": 12, "line_end": 94}, {"name": "findByUser", "kind": "method", "line_start": 18, "line_end": 31} ]
Details
Cache key is `(path, mtime)` — unchanged files return instantly from memory. The SecretDetector short-circuits on no-match inputs (1 MB benign file: ~25 ms). When the outline is empty (file not in index), falls back to reading full content up to `limit`.
See also
senkani_fetch— Read a single symbol's lines instead of the whole file.senkani_outline— Just the outline, no content toggle.senkani_search— Find where a symbol is defined before reading.cache (C toggle)— Disable the read cache per-pane.
Sources/MCPServer/Tools/ReadTool.swift