Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyProgramming

Token Savior

Lets your AI agent navigate code by symbol and keep persistent memory to use fewer tokens.

1.2k stars on GitHubby MibayyLicense MITUpdated last month

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add token-savior -e WORKSPACE_ROOTS="<your value>" -- uvx token-savior-recall

What to fill in

NameWhat it isRequired
WORKSPACE_ROOTSComma-separated list of absolute paths to project roots to index.Yes
TOKEN_SAVIOR_CLIENTOptional client identifier (e.g. 'claude-code', 'cursor', 'hermes') for usage attribution.No
TOKEN_SAVIOR_PROFILEManifest size. 'optimized' (recommended) advertises the Pareto-optimal 15-tool set; 'auto' sizes it from your own usage; 'full' advertises every tool; 'compact-only' if you already run symbol navigation elsewhere.No

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Find where the payment total is calculated and show only that function.
What did we decide about the cache last week?

What it is

Token Savior indexes your codebase by function, class and call graph so the agent can jump to code instead of reading whole files. It also stores decisions and bugfixes in a local memory that is brought back in later sessions. Optional Bash compaction and command rewriting reduce noisy command output.

What it can do

  • search_codebase: search code and name the function holding each hit
  • find_symbol: find a symbol
  • get_edit_context: context before editing
  • memory_search and memory_index: search and list stored memory
  • ts_discover: find missed token-saving opportunities in transcripts

When to use

  • β€ΊWhen your agent reads whole files to answer a question about a few lines.
  • β€ΊWhen you want decisions and fixes remembered across sessions.
  • β€ΊWhen noisy command output fills up the agent's context.

What you need

Python and pip install token-savior-recall[mcp]. Add it to your MCP config with WORKSPACE_ROOTS. On Claude Code, set alwaysLoad to true so its tools are not hidden behind ToolSearch.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

It is on PyPI with a project site. The readme does not mention a price.

Are the benchmark numbers verified?

The headline 97.9% result is reported but the benchmark harness is not public. A later re-run with 8 tasks showed about 45% lower cost but longer wall time.

Which profile should I use?

The optimized profile is recommended in the readme, set with TOKEN_SAVIOR_PROFILE=optimized.

Which agents can use the hooks?

ts init supports claude, cursor, gemini, codex and openclaw.

Do the Bash compactors shrink the current turn?

No. They run after the tool returns. The rewriter, enabled with TS_BASH_REWRITE=1, changes the command before it runs.

Where is memory stored?

In SQLite with full-text search and vector embeddings.

If it does not work

  • β€ΊOn Claude Code, set alwaysLoad to true, or the model may never use the tools.
  • β€ΊRun ts init --agent claude --dry-run to preview hook changes before applying them.
  • β€ΊSet WORKSPACE_ROOTS to your project folders.

5 new skills a week. 1 minute to read.