token-saver
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@token-saver outline the auth module so I can see what's in it before reading"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Token Saver
A Claude Code plugin and MCP server that makes Claude read less and still understand more. Instead of whole files, long logs or giant JSON, Claude gets compact views: outlines, single functions, grouped search hits, log digests and JSON shapes.
Read-only, sandboxed to the project folder, no network.
Measured savings
Measured with npm run bench on four public repositories (express, requests, godot-demo-projects, ripgrep), three real logs (npm, pip, vitest) and three JSON files (a lockfile, PyPI and npm registry metadata):
Task | Cases | Built-in tools | Token Saver | Saved |
Understand a file (outline instead of Read) | 129 | 571k | 53k | 91% |
Read one function (outline + read_symbol) | 129 | 571k | 91k | 84% |
Edit one function (outline + read_symbol + partial Read) | 129 | 571k | 128k | 78% |
Search a symbol (search_compact instead of Grep) | 40 | 68k | 13k | 81% |
Log / command output (digest) | 3 | 24k | 3.6k | 85% |
JSON structure (json_shape instead of Read) | 3 | 27k | 2.8k | 90% |
How it was measured, so you can judge it:
Files are source files with at least 150 lines; for small files the saving is smaller and reading them is fine.
Baselines are conservative: Read is capped at 2,000 lines / 25k tokens, Grep at 250 lines, Bash at 30,000 characters, as in Claude Code. Real full reads are often larger.
Tokens are counted with the o200k tokenizer because Claude's tokenizer is not public. Absolute numbers differ, ratios are comparable.
The "Edit" row counts the extra partial Read that Claude Code's Edit tool needs.
Fixed cost: the tool definitions take about 600 tokens per request (o200k), which one avoided full read usually pays back.
Related MCP server: token-saver-mcp
Install
Claude Code plugin (recommended)
/plugin install token-saver --marketplace tobertraubling2004-design/Token_SaverOn Claude Code older than 2.1.275: /plugin marketplace add tobertraubling2004-design/Token_Saver, then /plugin install token-saver@token-saver.
The plugin brings the bundled server (no npm install) and a Read hook: the first time in a session Claude tries to read a large file (≈6k tokens or more) in full, the hook suggests the cheaper tools. Repeating the same Read goes through. Set TOKEN_SAVER_GUARD=off to disable it, or TOKEN_SAVER_GUARD_TOKENS=12000 to change the threshold.
MCP server only
Requires Node.js 20+.
git clone https://github.com/tobertraubling2004-design/Token_Saver.git
cd Token_Saver && npm install && npm run build
# Claude Code
claude mcp add token-saver -- node /path/to/Token_Saver/dist/index.jsClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"token-saver": {
"command": "node",
"args": ["/path/to/Token_Saver/dist/index.js", "--root", "/absolute/path/to/project"]
}
}
}Tools
Tool | Instead of | Returns |
|
| Folder tree with token cost per entry (gitignore applied); on a file, its token cost |
| Reading a file to see what is in it | Classes, functions, types, headings with line numbers |
| Reading a file for one function | Only that function's or class's body |
| Reading a file for lines X–Y | Numbered line range, max 400 lines |
| Raw grep dumps | Hits grouped per file, max 8 per file, long lines clipped around the match |
| Pasting logs | Repeated lines grouped ( |
| Reading big JSON/JSONL | Keys, array lengths, maps collapsed, one sample per field |
Command output can be condensed before it reaches the context:
npm test 2>&1 | token-saver-mcp digest # or: node <plugin>/plugin/server.mjs digestThe server tells Claude the exact command in its instructions.
Outlines: TypeScript/JavaScript, Python, GDScript (Godot), C/C++ (incl. Unreal headers), C#, Java, Kotlin, Swift, Objective-C, Go, Rust, Lua, Ruby, PHP, shell, Markdown. Regex based: fast and dependency free, good for navigation, not a full parser.
Configuration
Setting | Effect |
| The only tree the server may read |
| Hide the |
| Do not apply |
Safety
Read-only: no writes, no shell, no network.
Paths outside the root, including symlinks pointing out, are rejected.
Binary files, lockfiles and build/cache folders are skipped.
Bad input never crashes the server; errors come back as tool results.
Development
npm install
npm test # vitest
npm run typecheck
npm run build # dist/ for npm
npm run build:plugin # plugin/server.mjs, commit it
npm run bench -- --repos <dir...> --logs <file...> --json <file...>See CONTRIBUTING.md and CHANGELOG.md.
License
Available Tools
7 toolsdigest_logARead-onlyIdempotent
Condense a log: repeats grouped (×N), errors/warnings kept. Pass path; text only for output you already have.
Inputs: path, text, maxLines.
file_outlineBRead-onlyIdempotent
Functions/classes/types/headings of a file with line numbers.
Inputs: path (required).
json_shapeCRead-onlyIdempotent
Structure of a JSON/JSONL file: keys, array lengths, sample values.
Inputs: path (required).
project_mapARead-onlyIdempotent
Folder tree with token cost per entry (gitignore applied). Use first.
Inputs: path, depth, maxPerDir.
read_sliceCRead-onlyIdempotent
Lines start-end (1-based, max 400).
Inputs: path (required), endLine (required), startLine (required).
read_symbolCRead-onlyIdempotent
Body of one function/class by name.
Inputs: path (required), symbol (required), maxLines.
search_compactBRead-onlyIdempotent
Grep the project; hits grouped per file, lines clipped. Literal, case-insensitive by default.
Inputs: query (required), glob, path, regex, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool targets a distinct inspection granularity: project tree, file outline, symbol body, line slice, grep search, log condensation, and JSON structure. The only apparent overlap is between file_outline/read_symbol/read_slice, but their descriptions make the boundaries clear. An agent can reliably choose the right tool.
All names use consistent snake_case and are concise and readable. The pattern mixes noun-first names (project_map, file_outline, json_shape) with verb-first names (read_symbol, read_slice, search_compact, digest_log), but this is a minor deviation rather than confusion.
Seven tools is well-scoped for a token-efficient codebase/log inspection server. Each tool covers a distinct exploration need without obvious redundancy.
The surface covers the core read-only inspection workflow: project structure, file outline, symbol extraction, line ranges, search, log summaries, and JSON shape. Minor gaps exist, such as no regex search or explicit multi-file/batch read operation, but agents can work around these with the provided tools.
Maintenance
Related MCP Connectors
Every employee asks your codebase from Claude, without access to it. Statistics on each developer.
Up to 90% fewer tokens: deterministic, declared tool calls, each with a receipt and an audit trail.
Cut tokens from HTML, JSON, logs and public URLs into compact context for LLMs.
Persistent context for Claude. Your AI always knows your projects and next actions across sessions.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to reduce token usage by 70-90% using a local LLM for codebase indexing, tool output compression, and turn summarization.63 npm3MIT
- FlicenseNot gradedqualityDmaintenanceAutomatically reduces token usage in Claude Code sessions using algorithmic optimizations like code compression, smart file reading, output summarization, and prompt rewriting, with no extra API calls or cost.1-
- AlicenseNot gradedqualityAmaintenanceReduces context window usage by 60-90% through intelligent caching, compression, and smart tool replacements for Claude Code and Claude Desktop.2,943 npm594MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI coding agents to retrieve focused, bounded repository context locally and read-only, reducing token usage while never modifying the repository or executing its code.-