Distill local libraries
into cited AI context
Folders full of PDFs, scans, and e-books quickly flood context windows and drop tables or diagrams. Vastglint builds a local macOS index for Claude Code, Google Antigravity, ChatGPT Work, Codex, or any MCP client, serving cited slices while keeping files tidy on disk.
Native Swift | macOS 14+ | CLI, MCP, Finder & plugins
What it solves
Token discipline for AI workflows meets lossless layout recovery and non-destructive disk hygiene.
-
Read cited passages, not raw binaries
A stdio MCP server, paired
PreToolUsehooks, and line-indexedBOOK.mdfiles keep agents out of raw PDF binaries. Through MCP queries or exported context packs, models receive exact matched lines under a strict token cap, cutting usage by roughly 90%. -
Keep tables, code, and diagrams intact
Column reconstruction, fenced code blocks, Reader highlights, and Apple Vision OCR keep scanned pages and complex layouts searchable. For figures and schematics, agents read extracted diagram text and cited pages before requesting any image bytes.
-
Search across scripts and shared citations
Hybrid BM25 and semantic search bridges writing systems including Latin, CJK, and Turkish, normalizing variant radicals and diacritics while mapping shared DOIs, arXiv IDs, and references across every indexed book.
-
Keep the underlying library clean on disk
Clean sweeps strip hidden XMP trackers, move exact duplicates safely to Trash without breaking multi-volume sets or PDF/EPUB pairs, and sort books into topic folders you can flatten or undo anytime.
Workflows
Sample outputs
Supported formats
Eleven book and office formats are auto-discovered inside directories. Loose Markdown and plain text notes (.md, .markdown, .txt) stay untouched unless selected alone or enabled with --include-text.
| Format | Decoder | Cleaning & dedupe | Indexing & retrieval |
|---|---|---|---|
PDF.pdf |
Native PDFKit / CG | Streaming XMP & /Info scrub, splash removal, volume-aware rename |
Font/ruling tables, code fences, Vision ANE OCR, vector diagrams, PDF notes |
EPUB.epub |
Native ZipOCF | OPF metadata wipe, promo/tracker URL strip, clean OCF repack | Chapter TOC ranges, XHTML entities, extracted figures, diagram OCR |
DjVu.djvu, .djv |
Native + djvulibre | Annotation wipe & canonical rename, keeping embedded text & outlines | Hidden text layer extraction and ddjvu + Apple Vision OCR fallback |
FB2.fb2, .fb2.zip |
Native XML | Strips promo paragraphs, tracker blocks, and stale document-info |
Section hierarchy, footnote text, embedded image decode & OCR |
Kindle.mobi, .azw3, .azw, .prc |
Native PalmDB | In-place EXTH tracker scrub while preserving exact binary offsets | Chapter recovery, metadata extraction, DRM guard, Markdown index |
Comic.cbz, .cbr |
Native ZIP + unar | Drops Thumbs.db, promo sheets, tracking tags in ComicInfo.xml |
Ordered page rendering through Apple Vision ANE OCR & figure extraction |
Office.docx, .odt, .rtf, .doc |
Native Zip / AppKit | Scrubs author/company metadata, tracker links, quarantine xattrs | Heading, list, and table recovery plus embedded media extraction |
Plain text.md, .markdown, .txt |
Opt-in | Skipped inside folders and mixed Cmd+A sweeps; cleaned standalone |
Indexed when selected standalone or enabled with --include-text |