Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.linksee.app/llms.txt

Use this file to discover all available pages before exploring further.

Every token costs money and context window space. read_smart is an MCP tool that caches file content and returns only what changed — saving 50-99% tokens on re-reads.

The problem

A typical agent session reads the same files multiple times:
  1. Read src/index.ts to understand the codebase (900 tokens)
  2. Make changes
  3. Read src/index.ts again to verify (900 tokens)
  4. Read it again after another change (900 tokens)
2,700 tokens for one file, but the content barely changed between reads.

The solution

read_smart maintains a per-file snapshot with content hashes:
ReadStatusTokensSavings
1stfirst_read — full content900
2nd (no change)unchanged — chunk list only5094%
3rd (1 function changed)modified — diff only20078%
4th (no change)unchanged5094%
Total1,200vs 3,600 naive

AST-aware chunking

Unlike line-based diffing, read_smart splits files into semantic chunks:

TypeScript / JavaScript

Parsed via @babel/parser into top-level declarations:
chunk: "createPool" (lines 7-25)
chunk: "getConnection" (lines 27-45)
chunk: "closePool" (lines 47-55)
If you add a new function at line 7, only that new chunk is “changed” — getConnection and closePool keep their identity (even though their line numbers shifted).

Python

Split by top-level def and class blocks using indentation analysis.

Markdown

Split by h2 and h3 headings.

Other files

Fixed 100-line windows.

Token estimation

Token count is estimated at 0.3 tokens per character — a blended rate that works for both English and Japanese text.

Cache storage

Snapshots are stored in the file_snapshots table in the same SQLite database as memories. No external services required.
ColumnPurpose
pathAbsolute file path
mtime_msLast modification time
sha256Full file hash
chunks_jsonArray of chunk definitions with individual hashes
total_tokensEstimated token count