Configures AI coding agents like Claude Code, Cursor, OpenCode and Codex with persistent memory, shared workflows, skills and MCP servers.
Mibayy/token-savior
MCP server for AI coding agents that indexes code by symbol and adds persistent memory and Bash command rewriting to cut token use.
- Stars
- 1,209
- Forks
- 110
- Open issues
- 9
- Last commit
- 23 days ago
What is it?
Token Savior is an MCP server that sits between an AI coding agent such as Claude Code and your codebase. Instead of letting the model read whole files to answer narrow questions, it indexes the project by symbol (functions, classes, imports and the call graph), so the agent can look up a definition or its dependents by pointer rather than by reading files in full.
It also includes a persistent memory engine that stores decisions, bug fixes, conventions and session summaries in SQLite with full-text and optional vector search, then re-injects a compact summary at the start of the next session. A PreToolUse Bash rewriter can edit commands before they run to shrink their output, and PostToolUse compactors render common tools such as git, pytest, kubectl and aws in a condensed form.
The server exposes tool profiles from a single tool to 68 tools, and a `ts init` command wires hooks into Claude Code, Cursor, Gemini, Codex and OpenClaw. A CLI (`ts`) is available for agents without MCP support.
Key features
- 01Symbol-level code navigation, including find_symbol and call-graph dependents
- 02Persistent memory stored in SQLite with full-text and optional vector search
- 03PreToolUse Bash rewriter that shrinks command output before it reaches the model
- 0434 PostToolUse compactors for git, test runners, cloud CLIs and Docker
- 05Configurable tool profiles and an `ts init` command for Claude Code, Cursor, Gemini, Codex and OpenClaw
Use cases
- Working with a large codebase where an agent keeps re-reading whole files to find small pieces of code
- Keeping architectural decisions and bug-fix notes available across multiple Claude Code sessions
- Reducing token cost and latency for an agent doing repeated navigation and test runs
- Giving non-MCP tools like Cursor or scripts shell access to symbol lookup via the ts CLI
Quick start
- 1
Install the package from PyPI with MCP support
pip install "token-savior-recall[mcp]" - 2
Add the server to your MCP config (e.g. Claude Code) with your workspace roots and profile
Things to know
- The headline benchmark figures are reported by the author and the harness repository is not public, so they cannot be independently verified.
- Claude Code users must set alwaysLoad to true, otherwise the tools are hidden behind ToolSearch and rarely used.
- PostToolUse Bash compactors do not reduce the current turn's tokens; only the PreToolUse rewriter does.
In collections
Topics
FAQ
- What is token-savior?
- MCP server for AI coding agents that indexes code by symbol and adds persistent memory and Bash command rewriting to cut token use. Token Savior is an MCP server that sits between an AI coding agent such as Claude Code and your codebase. Instead of letting the model read whole files to answer narrow questions, it indexes the project by symbol (functions, classes, imports and the call graph), so the agent can look up a definition or its dependents by pointer rather than by reading files in full.
- Is token-savior free to use? What license does it have?
- token-savior is open source under the MIT license. Check the license terms before using it in commercial products.
- Is token-savior still maintained?
- Actively maintained. The last commit to token-savior was on Oct 15, 2026.
- What can I use token-savior for?
- Working with a large codebase where an agent keeps re-reading whole files to find small pieces of code Keeping architectural decisions and bug-fix notes available across multiple Claude Code sessions Reducing token cost and latency for an agent doing repeated navigation and test runs Giving non-MCP tools like Cursor or scripts shell access to symbol lookup via the ts CLI
- How do I install token-savior?
- Install the package from PyPI with MCP support: pip install "token-savior-recall[mcp]" Add the server to your MCP config (e.g. Claude Code) with your workspace roots and profile
- Where can I get token-savior?
- The source code and installation instructions are on GitHub: https://github.com/Mibayy/token-savior
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A plugin for AI coding agents that keeps earlier images out of each request and lets the model pull back only the ones it needs.
A zero-dependency plugin that trims an AI coding agent's token use by tightening its prose, code style, and oversized tool output.
Open-source self-modifying AI agent that keeps its identity and memory across restarts, works on external projects, and can rewrite its own code.
Local, single-binary persistent memory for AI agents, using a four-graph knowledge store and LLM-supervised recall and writes across many coding agent runtimes.
A plugin for Claude Code, Codex, Copilot CLI and Pi that learns from past sessions in a repository to cut coding-agent token costs.