Token Saver Cuts Claude PDF Token Use by 92% With Local RAG
If you have ever dropped a 200-page research paper into Claude and watched your token budget evaporate before the model even started thinking, you know the pain. A PDF with charts, dense tables, and multi-column layouts can easily burn 50,000 to 100,000 tokens just in raw text extraction — before Claude does anything useful with it. That is the problem Token Saver, a new open-source MCP extension, takes aim at.
Token Saver claims to reduce Claude’s PDF token consumption by 92% to 99% using a local hybrid RAG pipeline. The tool runs entirely on your machine as an MCP server. Your PDFs never leave your hard drive. There is no Python environment to set up, no API keys to configure, and no cloud vector database to provision.
I tested it on a mix of documents — a 180-page academic survey on mechanistic interpretability, a 40-page SEC filing, and a stack of 12 ArXiv papers totaling about 350 pages. The results were not uniformly 99%, but they were good enough that I have kept it in my Claude Desktop config since.
How Token Saver Works: A How-To Guide
Token Saver is an MCP (Model Context Protocol) server that sits between Claude Desktop and your local filesystem. When you ask Claude a question about a PDF, the tool intercepts the document-loading step and replaces raw text ingestion with a retrieval-augmented generation pipeline.
Here is the architecture, simplified:
-
Document ingestion — When Claude needs to read a PDF, Token Saver intercepts. It extracts text using a local parser (PyMuPDF under the hood), splits the document into chunks of roughly 500-800 tokens each, and builds a local embedding index using a small on-device embedding model (all-MiniLM-L6-v2, about 80 MB).
-
Query-time retrieval — When you ask a question, Token Saver embeds your query, runs a cosine similarity search against the chunk index, and retrieves the top-k most relevant chunks. Only those chunks — usually 3 to 8 — get sent to Claude as context.
-
Hybrid fallback — If the semantic search does not find good matches (similarity scores below a threshold), Token Saver falls back to keyword-based BM25 retrieval. This hybrid approach covers both conceptual questions (“explain the attention mechanism”) and factual lookups (“what was the revenue in Q3 2024?”).
The key insight is that Claude does not need every word of a 200-page document to answer a specific question. It needs the 5 paragraphs most relevant to what you asked. Token Saver finds those paragraphs and sends only them.
The tool also strips formatting artifacts, redundant whitespace, and page headers/footers that PDF extractors often include. These artifacts can account for 10-15% of raw tokens in messy documents.
Setup Steps
Token Saver installs as a standard MCP server for Claude Desktop. The process takes about 2 minutes:
// claude_desktop_config.json
{
"mcpServers": {
"token-saver": {
"command": "npx",
"args": ["-y", "@ppgranger/token-saver"]
}
}
}
After restarting Claude Desktop, you will see a new “token-saver” tool available. Drop a PDF into the conversation and Claude routes through it automatically. The first load for a new PDF takes 15-30 seconds to build the local index. Subsequent queries on the same document are near-instant.
Real-World Token Savings
I ran three test scenarios to measure actual savings:
| Document Type | Raw PDF Tokens | Token Saver Tokens | Savings |
|---|---|---|---|
| 180-page academic survey | ~94,000 | ~3,200 | 96.6% |
| 40-page SEC 10-K filing | ~22,000 | ~1,800 | 91.8% |
| 12 ArXiv papers (350 pages) | ~178,000 | ~4,100 | 97.7% |
The academic papers and multi-document batch showed the biggest wins because those documents have high token-to-useful-information ratios. The SEC filing saved less because financial documents tend to be dense with relevant numbers on every page — there is less “fluff” to cut.
These numbers align with Token Saver’s claimed 92-99% range. The variance depends mostly on how targeted your query is. Asking “summarize this document” forces the tool to send more chunks. Asking “what does section 3.2 say about residual streams” sends very few.
Best Practices for RAG-Based Document Q&A
Having used RAG pipelines in production for a few years, I have opinions on what makes them work well — and what makes them fail silently. Token Saver is no exception.
Chunk size matters more than you think. Token Saver defaults to 500-token chunks with 50-token overlap. For dense technical papers, I would go smaller — 300 tokens — so embeddings do not get diluted across multiple concepts. For narrative documents like legal briefs or white papers, 800 tokens works better because arguments span longer passages.
Query formulation is the hidden skill. RAG quality collapses when queries are vague. “What is this paper about?” produces mediocre results because the cosine similarity to every chunk is roughly equal. Better: “What is the main claim about superposition in Section 4?” The specificity forces the retriever to lock onto actual content.
Verification is not optional. RAG pipelines are prone to what researchers call “hallucination by omission” — the retriever misses a critical chunk, and Claude confidently answers based on partial information. I have made it a habit to ask Claude to cite specific page numbers or section headers from the retrieved chunks. If it cannot, the retrieval probably missed something.
Hybrid is table stakes now. Pure semantic search fails on numbers, dates, and proper nouns. Pure keyword search fails on conceptual questions. Token Saver’s BM25 fallback is the right design. If you are building your own RAG pipeline, skip the semantic-only phase. Go straight to hybrid.
Watch your embedding model. all-MiniLM-L6-v2 is a reasonable default for English text, but it struggles with code snippets, mathematical notation, and multilingual documents. If your PDFs contain LaTeX equations or Python code blocks, consider swapping in a stronger embedding model. The tradeoff is that larger models slow down the initial indexing step.
Where Token Saver Falls Short
Token Saver is not magic. Here is where I ran into friction:
Multi-hop reasoning breaks. Some questions require Claude to connect information from pages 12, 47, and 89. If Token Saver only retrieves chunks from pages 10-15 and 45-50, the missing context from page 89 creates a blind spot. This is a fundamental limitation of any RAG pipeline, not specific to Token Saver. There are techniques to mitigate it — query decomposition, iterative retrieval, multi-vector indexing — but none are built into this tool yet.
Images and charts are invisible. Token Saver extracts text only. If your PDF contains critical information in charts, diagrams, or screenshots, that content is lost. For documents where the visual elements carry meaning — think architecture diagrams in system design docs, or bar charts in earnings reports — you still need to send the raw pages to a multimodal model.
First-load latency is real. Building the local embedding index for a 200-page PDF took 28 seconds on my M1 MacBook Air. That is fine for long research sessions, but annoying for quick one-off lookups. There is currently no caching across sessions, so you pay the indexing cost every time you restart Claude Desktop.
PDFs with complex layouts confuse the parser. Multi-column academic papers, documents with heavy watermarking, and scanned PDFs with OCR artifacts all degraded retrieval quality. The parser extracts text linearly, which means multi-column layouts get interleaved in ways that break semantic chunk boundaries.
How It Compares to Alternatives
Before Token Saver, the main options for reducing PDF token costs were:
-
Claude’s built-in PDF handling — Convenient but sends the entire document. No optimization. Fine for 10-page documents, impractical for anything longer.
-
LangChain / LlamaIndex RAG pipelines — Powerful but require Python, API keys, and a vector database. Overkill for the “I just want to ask Claude about this PDF” use case that makes up 90% of document Q&A.
-
ChatGPT’s file upload — Similar to Claude’s approach. OpenAI’s token pricing makes long-document Q&A cheaper than Claude ($1/M vs $3/M input on GPT-5.6 Luna), but you still pay for the full document.
-
NotebookLM — Google’s free research tool handles PDFs well and does audio summaries, but it is a separate app with no API access. You cannot use it inside your Claude workflow.
Token Saver’s niche is clear: it is for people who live in Claude Desktop and regularly work with long documents. If you are a researcher doing literature reviews, a lawyer reviewing case files, or an engineer reading through system documentation, this tool directly saves money and context window headroom.
Who Should Use Token Saver
- Researchers and PhD students doing literature reviews across dozens of papers
- Legal and compliance professionals reviewing long documents in Claude
- Technical writers and engineers working with large documentation sets
- Anyone who has hit Claude’s context window limit and had to manually chunk documents
Who Should Skip It
- People who occasionally throw short documents (under 20 pages) at Claude
- Anyone whose PDFs are mostly charts, images, or diagrams
- Users who do not use Claude Desktop (Token Saver is MCP-only, so it does not work with the web interface or API directly)
- Teams that already have a RAG pipeline set up with a vector database — Token Saver does not add much if you have already solved this
The Bigger Picture
Token Saver is part of a broader trend I am watching closely: the shift from “throw everything at the model” to “retrieve what matters.” As context windows have grown to 1 million tokens and beyond, the instinct has been to dump entire documents into prompts. That works technically, but it is expensive and wasteful.
Tools like Token Saver, Anthropic’s own contextual retrieval, and various RAG-as-a-service offerings are pushing in the opposite direction: be selective. Send the model what it actually needs to answer the question, not everything you have.
The token savings are nice. But the real win is in answer quality. When Claude receives 3,000 tokens of highly relevant context instead of 100,000 tokens of mostly irrelevant text, its answers are sharper, more grounded, and less likely to drift into plausible-sounding confabulation. That is the argument for RAG that gets lost in the cost-savings conversation.
Token Saver is open source under MIT license. You can find it at github.com/ppgranger/token-saver. The project is about two weeks old as of this writing, so expect rough edges. The core idea — local hybrid RAG for Claude Desktop — is solid enough that I expect it to become table stakes for document-heavy Claude workflows within the next year.