An MCP server that teaches agents to navigate by pointer, not cat
It stops AI coding agents from burning tokens on full-file reads, session amnesia, and verbose shell output.

What it does
Token Savior is an MCP server that sits between your coding agent and the codebase. It indexes symbols, call graphs, and imports so the model can query specific functions instead of cat-ing whole files. A persistent memory layer stores session rollups, conventions, and bugfixes in SQLite with vector search, re-injecting relevant context at the start of new sessions. Since v4.1, it also compacts noisy Bash output—git status, pytest, kubectl logs, and 31 other command families—through pure-function renderers that strip boilerplate before it hits the context window.
The interesting bit
The project treats token budgets like a systems problem, not a prompt-engineering hack. It ships 34 Bash compactors and a PreToolUse rewriter that silently swaps verbose flags for dense ones before execution, then collapses the output after. The optimized profile exposes only 15 hot tools and a thinned manifest to keep the system prompt lean.
Key highlights
- Claims 97.9% on tsbench (188/192 tasks) with -80% active tokens and -83% wall time versus plain Claude Opus 4.7, per the README benchmark table.
- Structural navigation:
find_symbolandget_change_impactreplace full-file reads; one cited example drops a 41M-character full read to 67 characters. - Persistent memory engine using SQLite WAL + FTS5 + vector embeddings, ranked by Bayesian validity and ROI.
ts_discoverscans Claude Code transcripts to flag missed optimization patterns like Read→Grep→Read chains.ts initCLI auto-merges hook configs for Claude, Cursor, Gemini, and Codex with unified diffs and backups.- 1,688 tests passing in CI on Python 3.11–3.13.
Caveats
- The benchmark numbers come from the project’s own
tsbenchsuite; independent verification is not discussed in the README. - Bash compaction, the PreToolUse rewriter, and vector memory are opt-in features gated behind environment flags or profile selection, so the headline savings require additional activation.
- The README itself is truncated mid-sentence in the “Optional env vars” section, leaving some configuration details incomplete.
Verdict
Worth a look if you run an MCP-compatible coding agent on large codebases and your context window feels like a leaking bucket. Less compelling if you already have a custom retrieval and memory stack you trust, or if you rely on the non-MCP CLI path where the README notes higher overhead.
Frequently asked
- What is Mibayy/token-savior?
- It stops AI coding agents from burning tokens on full-file reads, session amnesia, and verbose shell output.
- Is token-savior open source?
- Yes — Mibayy/token-savior is open source, released under the MIT license.
- What language is token-savior written in?
- Mibayy/token-savior is primarily written in Python.
- How popular is token-savior?
- Mibayy/token-savior has 1k stars on GitHub.
- Where can I find token-savior?
- Mibayy/token-savior is on GitHub at https://github.com/Mibayy/token-savior.