Token Savior is an MCP server for AI coding agents that combines structural code navigation, persistent project memory, and Bash command rewriting. It is intended to help coding agents work through repositories with less token use and shorter execution times, and its catalogue add-ons configure or guide its use.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/mibayy/token-savior/claude-mdgit clone --depth 1 https://github.com/Mibayy/token-saviorWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/mibayy/token-savior/claude-md)<a href="https://agentmods.dev/instructions/mibayy/token-savior/claude-md"><img src="https://agentmods.dev/badge/instructions/mibayy/token-savior/claude-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01116 | $0.01116 |
| Opus 5 | $0.00558 | $0.00558 |
| Sonnet 5 | $0.00223 | $0.00223 |
| Haiku 4.5 | $0.00112 | $0.00112 |
Grade A, and why
token-savior CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Token Savior — recommended config for Claude Code
This file is auto-discovered by Claude Code. It tells the agent how to use Token Savior efficiently. Drop this CLAUDE.md (or its contents) at the root of your own project to reproduce the 97.9% / −80% active-tokens result on tsbench.
Defaults the bench uses
TS_PROFILE=tiny_plus # 15 tools, ~2.5 KT manifest
TS_CAPTURE_DISABLED=1 # skip read-side capture sandboxing
tiny_plus is the Pareto-optimal profile. It exposes exactly the 15 tools
agents reach for after the first turn — locate, read, edit, audit, graph,
git, and config — and hides the rest behind ts_search (Nomic embeddings
on tool descriptions). Manifest math: tiny_plus ~2.5 KT vs lean ~7 KT vs
full ~10 KT.
Tool routing (use these, not natives)
| Goal | Tool | Replaces |
|---|---|---|
| Locate a symbol | find_symbol(name) |
grep -rn |
| Read a function / class | get_function_source(name) / get_class_source(name) |
cat + scroll |
Read a range when you hold a line number (traceback, grep -n, compiler error) |
read_lines(file_path, start, end) |
sed -n '105,150p', head, tail |
| One-shot context (loc + source + callers + deps) | get_full_context(name) |
the whole chain |
| Search across project | search_codebase(pattern) |
grep / rg |
| Discover any other tool | ts_search(query) |
reading docs |
Edit code (.py/.ts/.tsx/.js/.jsx) |
replace_symbol_source / insert_near_symbol |
Edit / Write |
Add a model field (.prisma/.py/.ts) |
add_field_to_model |
hand edits |
| Move a symbol with import fixup | move_symbol(name, target_file) |
copy-paste |
| Detect import cycles | find_import_cycles |
manual reasoning |
| Detect duplicates | find_semantic_duplicates(max_groups=30) |
manual review |
| Diff between refs | detect_breaking_changes(ref="v1") |
git diff reading |
| Find dead code | find_dead_code |
manual hunting |
| Audit config (orphans / secrets) | analyze_config(checks=["orphans"]) |
manual checks |
| Git status (structured) | get_git_status |
git status parsing |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 80 lines · 1,116 tokens per session scan A 5811bef579fd
token-savior CLAUDE.md is an instructions file published in the GitHub repository Mibayy/token-savior (1,142 stars, last pushed 25d ago), licensed MIT. It adds 1,116 tokens to every session, about $0.0056 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.