
Token Savior MCP Server: Code Navigation and Memory for AI Coding Agents
Lets Claude Code, Cursor and other coding assistants find and edit code by function name, and remember notes between sessions.
This is a community server by Mibayy. It runs on your computer as a Python program. It indexes the project folders you give it, with no account or key. Instead of reading a whole file, the assistant asks for one function, one caller list or one edit.
The README recommends the "optimized" setting, which shows the assistant 15 tools. The code default is "full", which shows all 72. Hidden tools stay callable by name. A separate command, ts init, can also add hooks to your Claude Code settings, covered in the safety section.
Good for
- Developers whose assistant burns tokens reading whole files
- People who want an assistant to remember project rules between sessions
- Teams that want to measure how many tokens a coding agent wastes
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install Token Savior MCP
Claude Code
- 1
Copy this prompt.
Add the Token Savior MCP server to Claude Code. Run this command: claude mcp add token-savior -e WORKSPACE_ROOTS=<WORKSPACE_ROOTS> -- uvx --from token-savior-recall token-savior Ask me for WORKSPACE_ROOTS and only put the values in that config, nowhere else. Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires uv (Python 3.11+).
Use the uvx form with the --from option. The package has no command named token-savior-recall, so the shorter uvx token-savior-recall in the README fails to find a program to run. Set WORKSPACE_ROOTS to your project folders. The README advises "alwaysLoad": true in the config for Claude Code 2.1.28x and later, so the tools are not hidden behind tool search.
Built from the package data we hold. Not yet tested by us.
Tools
Finds where a function or class is defined
Returns the file, line, signature and a preview for a name, definitions only, where a text search returns every mention. Looks at functions and classes first, then module constants.
Try: “Where is parse_config defined?”
Read ·
find_symbolReads one function without opening the file
Returns the source of a function or method by name, with no path needed. Can take a list of names and a detail level.
Try: “Show me the source of handle_request”
Read ·
get_function_sourceReads one class with its methods
Returns the body of a class including its methods, by name. Can batch up to ten names.
Try: “Show me the UserSession class”
Read ·
get_class_sourceReads an exact range of lines
Returns lines start to end of a file, up to a cap of 400, and names the function or class that holds the first line. Meant for line numbers from stack traces or lint errors.
Try: “Read lines 105 to 150 of app/server.py”
Read ·
read_linesSearches code and names the function around each hit
Regex search over the project (or semantic ranking with semantic=true) where each hit also names the function or class that contains it. The description says to use it instead of Grep or rg.
Try: “Find every place we call send_email”
Read ·
search_codebaseRegex search that returns the enclosing symbol
Returns each match with its file and line plus the function or class around it.
Try: “Search for TODO inside function bodies”
Read ·
search_in_symbolsBundles a symbol with its callers and callees
Returns the location, source and, at depth 1, dependencies and dependents. At depth 2 it adds change impact.
Try: “Give me full context on process_order”
Read ·
get_full_contextCollects what you need before editing a symbol
Returns the source, direct dependencies, callers, siblings in the same file and impacted tests in one call.
Try: “What do I need to know before changing validate_token?”
Read ·
get_edit_contextLists what a symbol calls
Shows outgoing dependencies of a function or class, to a chosen depth.
Try: “What does build_report call?”
Read ·
get_dependenciesLists who calls a symbol
Shows the direct references to a symbol across the project.
Try: “Who calls charge_card?”
Read ·
get_dependentsShows what a change could break
Returns direct and transitive dependents of a symbol.
Try: “What could break if I change User.email?”
Read ·
get_change_impactFinds the path between two functions
Returns the shortest dependency path between two symbols using a breadth-first search of the graph.
Try: “How does the router reach save_order?”
Read ·
get_call_chainLists files a file imports
Shows the outgoing file-level import edges for one file.
Try: “What does api/routes.py import?”
Read ·
get_file_dependenciesLists files that import a file
Shows the incoming file-level import edges for one file.
Try: “Which files import utils/dates.py?”
Read ·
get_file_dependentsLists functions in a file or project
Returns functions with names, lines and files, from one file or the whole project. Output is compact by default.
Try: “List the functions in billing.py”
Read ·
get_functionsLists classes
Returns class names, line ranges, methods, bases and files.
Try: “List all classes in the models folder”
Read ·
get_classesLists a file's imports
Returns each import with its module, names and line.
Try: “Show the imports in main.py”
Read ·
get_importsSummarises a file's structure
Returns functions, classes, imports and line counts for one file, or for the whole project if you omit the file.
Try: “Give me an outline of server.py”
Read ·
get_structure_summaryGives a project overview
Returns the file count, packages, top classes and functions, and infrastructure folders.
Try: “Summarise this project”
Read ·
get_project_summaryLists indexed files
Lists the files the index knows about, optionally filtered by a glob.
Try: “List all test files”
Read ·
list_filesFinds the files behind a feature
Returns files matching a keyword plus the files they import, labelled as core, test or config.
Try: “Which files make up the checkout feature?”
Read ·
get_feature_filesLists registered projects
Shows each registered workspace project and whether its index is ready.
Try: “Which projects are registered?”
Read ·
list_projectsSwitches the active project
Makes another registered project the active one by name or path.
Try: “Switch to the api project”
Write ·
switch_projectRegisters a new project folder
Adds a path as a project root and switches to it. A path that is already registered becomes a quick switch, with no reindex unless force is set.
Try: “Add /Users/me/code/shop as a project”
Write ·
set_project_rootRebuilds the code index
Rebuilds the project index. The index is also saved as a cache file inside the project.
Try: “Reindex the project”
Write ·
reindexShows structured git status
Returns the branch, ahead and behind counts, and staged, unstaged and untracked files.
Try: “What is my git status?”
Read ·
get_git_statusLists changed functions and classes
Summarises worktree changes at the symbol level, or HEAD compared with a ref.
Try: “Which functions changed since main?”
Read ·
get_changed_symbolsDrafts a commit narrative
Returns a compact summary with stats, hotspots and a suggested commit type.
Try: “Write a commit summary for my changes”
Read ·
build_commit_summaryFinds API breaking changes
Compares against a git ref and lists removed functions or parameters, new required parameters and signature changes.
Try: “Any breaking changes since v1.2?”
Read ·
detect_breaking_changesRuns the type checker and groups errors by symbol
Runs the checker the project already declares (tsc, mypy or pyright) and maps each error to its enclosing function. Output is bounded and says what it cut.
Try: “Run the type checker and show errors by function”
Runs code ·
get_diagnosticsGuesses which tests a change affects
Infers the pytest files likely impacted by changed files or symbols.
Try: “Which tests cover my changes?”
Read ·
find_impacted_test_filesRuns the tests a change affects
Runs pytest on the files impacted by the current changes, with a timeout and an output cap.
Try: “Run the tests affected by my edit”
Runs code ·
run_impacted_testsLists the project's build, test and lint commands
Reads build files such as package.json and pyproject.toml and lists conventional actions without running them.
Try: “What commands can this project run?”
Read ·
discover_project_actionsRuns a project command by id
Runs one of the discovered actions, for example an npm script, with a timeout and an output cap. Scripts named start or dev count as actions too.
Try: “Run the lint action”
Runs code ·
run_project_actionRewrites a whole function or class
Replaces a function or class by name with new source, with no need to read the file first.
Try: “Replace parse_date with this new version”
Write ·
replace_symbol_sourceEdits text inside one function or class
Swaps an exact old string for a new one, matched only inside the named symbol. replace_all changes every match inside that symbol.
Try: “In handle_login, change the timeout from 30 to 60”
Write ·
edit_lines_in_symbolInserts code before or after a symbol
Adds content directly before or after an indexed function or class.
Try: “Add a helper function after build_report”
Write ·
insert_near_symbolMoves a function to another file
Moves a symbol to a different file and updates imports at the call sites. It can create the target file.
Try: “Move format_price into utils/money.py”
Write ·
move_symbolAdds a field to a model
Adds a field to a model, class or interface. Works with .prisma files, Python dataclasses and SQLAlchemy models, and .ts or .tsx.
Try: “Add a nullable phone field to the User model”
Write ·
add_field_to_modelSaves, restores or deletes file snapshots
One tool with operations create, list, restore, delete, prune and compare. Creating copies the listed files, restoring copies them back over your files, and delete and prune remove saved snapshots.
Try: “Create a checkpoint of app/models.py”
Delete ·
checkpointTraces where an env var is used
Cross-references a variable across code, .env files and workflow configs, showing where it is defined, read and written.
Try: “Where is DATABASE_URL used?”
Read ·
get_env_usageAudits config files
Checks .env, yaml, toml and json files for duplicates, secrets and orphans.
Try: “Check my config files for leaked secrets”
Read ·
analyze_configAudits Dockerfiles
Lists base images, stages, exposed ports and ENV or ARG values, and cross-references them with config files.
Try: “Review my Dockerfiles”
Read ·
analyze_dockerSummarises your SQL migrations
Builds a snapshot of tables, columns, types, keys, indexes and row-level security policies from migration files.
Try: “What tables exist according to my migrations?”
Read ·
get_db_schemaLists API routes in a Next.js app
Detects pages and API routes in a Next.js App Router project with path, file, HTTP methods and type.
Try: “List my Next.js routes”
Read ·
get_routesRanks likely entry points
Scores functions by how likely they are routes, handlers, main functions or exported APIs.
Try: “What are the entry points of this codebase?”
Read ·
get_entry_pointsFinds unused functions and classes
Audits for functions and classes with zero callers, skipping entry points, tests and route handlers.
Try: “Find dead code in src”
Read ·
find_dead_codeRanks risky functions
Ranks functions by complexity for all languages, or allocation and performance for Java.
Try: “Which functions are the most complex?”
Read ·
find_hotspotsFinds duplicate functions
Finds copy-pasted code by AST hash, or similar-meaning code with embeddings.
Try: “Find duplicated functions”
Read ·
find_semantic_duplicatesFinds circular imports
Detects cycles in the file-level import graph.
Try: “Do I have any circular imports?”
Read ·
find_import_cyclesSaves a note to memory across sessions
Stores a fact, guardrail or note, optionally tied to a symbol or file, with importance and an expiry. Notes persist between sessions in a local database.
Try: “Remember that we never use raw SQL in this repo”
Write ·
memory_saveShows an index of recent memories
Layer 1 of the memory lookup. Returns a compact list of recent notes with id, type, title, importance and age.
Try: “What have you remembered recently?”
Read ·
memory_indexSearches your saved memories
Layer 2. Full-text search over memory notes that returns short snippets.
Try: “Search memory for notes on auth”
Read ·
memory_searchReads full memory notes by id
Layer 3. Returns the full content of the notes whose ids you give.
Try: “Show memory notes 12 and 15”
Read ·
memory_getArchives a memory note
Soft-deletes a note by id by marking it archived. The row stays in the database.
Try: “Delete memory note 12”
Delete ·
memory_deleteRuns memory maintenance
One tool for status, doctor, dedup_sweep, distill, consistency, vector reindex and other maintenance operations on the memory store.
Try: “Run a memory status check”
Write ·
memory_adminBuilds a themed set of memories
Collects memory notes filtered by type, tags or symbol into a named corpus.
Try: “Build a corpus of all auth-related notes”
Write ·
corpus_buildAsks a question over a corpus
Formats all notes in a named corpus as markdown with your question, ready for the assistant to answer.
Try: “Using the auth corpus, what rules did we set?”
Read ·
corpus_querySaves a reasoning trace
Stores a goal, steps and conclusion with a confidence level so they can be reused later.
Try: “Save how we debugged the cache bug”
Write ·
reasoning_saveFinds past reasoning traces
Searches stored reasoning chains by goal similarity.
Try: “Have we solved a cache problem before?”
Read ·
reasoning_searchLists saved reasoning traces
Lists stored chains ordered by how often they were used, then recency.
Try: “List my saved reasoning chains”
Read ·
reasoning_listStores a long tool output for later search
Saves verbose tool output in a local full-text store and returns an id and preview. Hooks normally call this, not the assistant.
Try: “Store this build log for later”
Write ·
capture_putSearches stored tool outputs
BM25 search across the sandboxed outputs, returning ids, snippets and sizes.
Try: “Search captured outputs for "timeout"”
Read ·
capture_searchReads a stored tool output
Reads a capture by id, as head, tail, all, a preview or a line range.
Try: “Show the tail of capture 42”
Read ·
capture_getSummarises a stored output
Runs stats, line counts, unique lines or a regex extract or count over one capture.
Try: “Count error lines in capture 42”
Read ·
capture_aggregateLists stored tool outputs
Lists recent captures, newest first, filtered by session, project or tool.
Try: “List my recent captures”
Read ·
capture_listDeletes stored tool outputs
Deletes captures by age, session or project. At least one filter is required.
Try: “Purge captures older than a week”
Delete ·
capture_purgeShows usage and savings stats
One tool for several report categories such as usage, session budget and other internal statistics.
Try: “Show my Token Savior usage stats”
Read ·
get_statsFinds where Token Savior would have saved tokens
Scans your Claude Code session transcripts for chains of native calls that one Token Savior call could replace, or reports adoption ratios. The description calls it read-only and free of personal data.
Try: “How often did I use Token Savior tools last week?”
Files ·
ts_discoverLists outdated results in the session
Scans recent transcripts for tool results made obsolete later in the same session, such as a file read and then edited.
Try: “What in this session is stale?”
Files ·
ts_stale_contextFinds the right Token Savior tool
Ranks Token Savior's own tools against a plain-language question using embeddings and returns each candidate with its schema.
Try: “Which tool finds who calls a function?”
Read ·
ts_searchRuns a JavaScript script that chains tools
Runs a JavaScript body in a Node vm context that can call only a fixed list of 41 Token Savior tools, including the editing ones, checkpoint (restore, delete), reindex and switch_project. It has no require or process. Node does not treat vm as a security boundary, so this is not a hard sandbox.
Try: “Find dependents of save_order and read each in one script”
Delete ·
ts_execute
Read from the source code
Permissions
high risk · 8 things to watch
High risk
The assistant can edit your source files, run project commands and delete saved snapshots and notes. Work in a git checkout, approve edit and run calls, and leave the ts init hook installer for later.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It runs project commands on your machine
run_project_action runs a discovered action such as an npm script, and get_diagnostics and run_impacted_tests run tsc, mypy, pyright or pytest. A project script runs with your permissions, so check the project first. github.com
ts_execute runs scripts with limited, not hard, isolation
The script runs in a Node vm context with a short list of globals (no require or process) and can call 41 listed tools, among them replace_symbol_source, move_symbol, checkpoint (restore and delete), reindex and switch_project. run_project_action, get_diagnostics and run_impacted_tests are not on that list. The worker is a normal Node process with no OS sandbox, and Node says vm is not a security mechanism. github.com
It rewrites your source files
replace_symbol_source, edit_lines_in_symbol, insert_near_symbol, move_symbol and add_field_to_model change files in place. Use git, and approve edits before they run. github.com
It can overwrite or delete saved data
checkpoint with restore copies saved files back over your current ones, and with delete or prune removes snapshots. memory_delete archives notes and capture_purge deletes stored outputs. github.com
The optional installer adds always-on hooks to Claude Code settings
`ts init --agent claude` merges four hook bundles into ~/.claude/settings.json, after printing a diff and saving a backup. Memory hooks (session start, every prompt, pre/post tool use, compaction, stop) and the tool-capture hook are active as soon as they are installed. The Bash rewriter is off until TS_BASH_REWRITE=1; once on, it answers permissionDecision allow for the commands it rewrites, so those skip the permission prompt. The discipline guard stays inert unless TS_DISCIPLINE_GUARD=1. github.com
Hidden tools can still be called
The optimized profile only changes what is advertised. The code states that a filtered-out tool still runs if called by name. github.com
Tool descriptions push the assistant to use them
search_codebase says to use it instead of Grep or rg on code. This steers the assistant away from its built-in tools, which is the product's purpose but worth knowing. The README adds that `alwaysLoad` is needed so the model does not reach for Read and Grep. Server-level instructions that push the same way exist but are off unless TS_DISCIPLINE=1. github.com
It writes files next to your code
The index is cached in a .token-savior-cache.json file inside each project, so add it to your ignore file. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | No read-only mode is documented. The profile setting only changes which tools are advertised, and the code says handlers stay callable by name. |
|---|---|
| Sign-in and keys | No credentials. Memory notes and captures are stored in a local SQLite database under ~/.local/share/token-savior, or the folder named by TOKEN_SAVIOR_DATA_DIR or XDG_DATA_HOME. |
Questions
Is Token Savior official?
No. It is a community project by Mibayy. It is not made by Anthropic, Cursor or any editor vendor.
How do I add Token Savior to Claude Code?
Use the install box above. Set WORKSPACE_ROOTS to your project folders. The README advises "alwaysLoad": true for Claude Code 2.1.28x and later.
How many tools does it have?
72 in the published 4.24.0 package, which is the default. The README says 68, which is out of date. With TOKEN_SAVIOR_PROFILE=optimized the assistant sees 15 of them.
Does it need an API key?
No. The README and package metadata name no key or account. The optional vector memory search installs an embedding library with the memory-vector extra.
Does the uvx command in the README work?
The package has no program named token-savior-recall, so uvx token-savior-recall does not match one. The install box uses uvx --from token-savior-recall token-savior.
Can I run it read-only?
No. There is no read-only mode. Even the 15-tool setting includes replace_symbol_source and add_field_to_model, and other tools stay callable by name.
Does it change my Claude Code settings?
Only if you run ts init. Installing the server alone does not. ts init --agent claude merges four hook bundles into ~/.claude/settings.json after printing a diff and saving a backup. The memory and tool-capture hooks are active once installed; the Bash rewriter and the discipline guard stay off until you set their environment variables.
Where is my memory stored?
In a local SQLite file named memory.db under ~/.local/share/token-savior by default. Set TOKEN_SAVIOR_DATA_DIR to move it.
What license is it under?
MIT. The published wheel includes the license file.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
token-savior-recall- Registry
- PyPI
- Transport
- stdio
- Auth
- None
- Version
- 4.13.0
- License
- MIT
- Last commit
- Oct 15, 2026
- Open issues
- 7
- Listed in
- Official MCP registry
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 4Hide
- Token Savior README · github.com
- token-savior-recall on PyPI · pypi.org
- tool_schemas.py · github.com
- server.py · github.com