You probably use Claude Code, Cursor, or Windsurf every day — but if you're not running an MCP server called Token-Savior alongside it, you're burning 80% more tokens than you need to. That's not an exaggeration. On a real benchmark of 96 coding tasks, Claude Code with Token-Savior scored 97.9% (188/192) versus 78.3% (141/180) without it — and used 80% fewer active tokens per task.
The tool is open source, takes 90 seconds to install, and has 1,688 tests passing. Here's what most developers don't know about it.
The MCP ecosystem has exploded in 2026, but most teams are only using MCP to expose tools — not to observably reduce what those tools cost to run. Token-Savior changes that calculus entirely.
Hidden Use #1: The Single-Env-Var Profile That Hits 97.9% on tsbench
What most people do: Install Token-Savior and leave it on default settings, which is fine for basic use but doesn't unlock the benchmark-grade performance.
The hidden trick: Set one environment variable before your first Claude Code session:
export TS_PROFILE=optimized
That's it. One env var. The optimized profile is what the maintainers used for the 96-task tsbench run — it skips the read-side capture sandbox (TS_CAPTURE_DISABLED=1) which adds overhead on every tool call, and it activates the full compactor registry (34 compactors covering pytest, git, grep, find, cat, gh, kubectl, eslint, and more).
The result: From the tsbench README, the difference on 96 real coding tasks (Claude Opus 4.7, May 2026):
| Metric | Plain Claude Code | With TS_PROFILE=optimized |
|---|---|---|
| Score | 141/180 (78.3%) | 188/192 (97.9%) |
| Active tokens/task | 17,221 | 3,395 |
| Wall time/task | 110.6s | 18.9s |
Reproduces with git clone https://github.com/Mibayy/tsbench && cd tsbench && python3 generate.py --seed 42 && git tag v1 && python3 breaking_changes.py && git tag v2 && TS_PROFILE=tiny_plus TS_CAPTURE_DISABLED=1 python3 bench.py --tasks all --run B.
Data sources: Token-Savior GitHub 971 Stars; tsbench benchmark source (https://github.com/Mibayy/tsbench) — verified May 2026.
Hidden Use #2: The Bash Output Compactor That Saves 20.4K Tokens Per Week
What most people do: Let Claude Code output raw Bash results — grep -r returning 500 lines, git status dumping full diffs, find . printing every filename unfiltered.
The hidden trick: Token-Savior's 34 Bash compactors automatically detect and compress common command outputs before they enter the LLM context window. The optimized profile runs them on every PreToolUse event (rewriting the command) and PostToolUse event (compressing the output).
For example, a grep -rn "TODO" --include="*.py" that returns 300 lines gets compacted to a 5-line summary: file count, hit count per file, common prefix stripped. A git diff that dumps 10KB of diff output gets compacted to the changed line count and file list.
From the v4.3.0 release notes, the real-world savings over 7 days of transcripts (1,130 Bash outputs):
- 19.3% match rate (1 in 5 commands has a known compactor)
- 68.9% mean compaction ratio on matched outputs
- ~20.4K tokens/week saved vs ~12K/week on v4.2.0
# The compactor registry — it's just a dict of (command, output_pattern) → compaction_fn
# From src/token_savior/compactors/
COMPACTORS = {
"grep": {
"pattern": r"grep -[rHn] (.+) --include=(.+)",
"compact": compact_grep_output, # groups hits by file, strips common prefix
},
"git": {
"checkout": compact_git_checkout,
"fetch": compact_git_fetch,
"branch": compact_git_branch,
"worktree list": compact_git_worktree_list,
"stash list": compact_git_stash_list,
"status": compact_git_status,
"diff": compact_git_diff,
"pr diff": compact_git_pr_diff,
"pr view": compact_git_pr_view,
"issue view": compact_git_issue_view,
"repo view": compact_git_repo_view,
},
"find": compact_find_output, # groups by directory, head/tail truncation
"cat": compact_cat_output, # strip large binary, truncate to 50 lines
"pytest": compact_pytest_output, # matches python3 -m pytest, uv run pytest, etc.
"jest": compact_jest_output,
"vitest": compact_vitest_output,
"eslint": compact_eslint_output,
"biome": compact_biome_output,
"kubectl get": compact_kubectl_get,
}
The result: A typical hour of coding with Claude Code generates ~3-5K tokens of Bash output. With Token-Savior's compactors active, that's reduced to ~1-1.5K tokens — and the LLM still sees the semantic content it needs to make decisions.
Data sources: Token-Savior v4.3.0 release notes (https://github.com/Mibayy/token-savior/releases/tag/v4.3.0) — 7-day bench, 1,130 Bash outputs, 19.3% match rate, 68.9% mean compaction, ~20.4K tokens/week savings.
Hidden Use #3: ts discover — Find Which Commands Are Eating Your Context Budget
What most people do: Run Claude Code for weeks without knowing which Bash commands are the biggest token sinks. There's no built-in view for "this git diff command cost you 8,000 tokens."
The hidden trick: The ts discover command scans your Claude Code transcript history (~/.claude/projects/*/*.jsonl) and identifies which commands have known compactors and which don't. Unmatched commands are the optimization opportunities.
# Install ts CLI (for non-MCP agents like Cursor, Aider, Continue)
pip install "token-savior-recall[cli]"
# Run discover against your transcript history
ts discover ~/.claude/projects/my-project/*.jsonl
# Output example:
# Compactor coverage for 7-day window:
# grep: 127 calls, 94% avg compaction, ✓ matched
# pytest: 43 calls, 89% avg compaction, ✓ matched
# git diff: 28 calls, 76% avg compaction, ✓ matched
# kubectl: 12 calls, 91% avg compaction, ✓ matched
# cargo: 0 calls, -- , ✗ NO COMPACTOR
# webpack: 0 calls, -- , ✗ NO COMPACTOR
# [unmatched] find: 34 calls, avg output 4.2KB, consider adding to registry
The bench_compactors_unmatched.py script in the repo buckets unmatched commands so the next compactor target is obvious from the histogram. If find is your biggest unmatched command, the maintainers have a clear signal to add it next.
The result: Teams running ts discover across their Claude Code history consistently find that the top 3 unmatched commands account for 40-60% of their Bash output token consumption. Adding a single compactor for find (which outputs full directory trees) can save 10-20% of total daily token usage.
Data sources: Token-Savior README — ts discover + scripts/bench_compactors_unmatched.py script documentation; confirmed works with Claude Code transcript JSONL format.
Hidden Use #4: Structural Code Navigation — Codebase Context Without the Full File
What most people do: Ask Claude Code to read an entire 500-line file just to find the definition of my_function. Claude reads the whole thing, spends tokens on code it doesn't need, and often loses track of where the relevant section starts.
The hidden trick: Token-Savior's structural code navigation tools (ts get, ts search) extract only the symbols, function signatures, and call graph relationships — not the full file bodies. When Claude needs to understand my_function, it gets:
{
"symbol": "my_function",
"file": "src/utils/auth.py",
"signature": "def my_function(user_id: str, token: str) -> AuthResult",
"callees": ["verify_token", "hash_password", "create_session"],
"callers": ["login_handler", "refresh_handler"],
"imported_by": ["routes.py", "middleware.py"]
}
Not 500 lines of implementation detail. Just the structural fingerprint.
The result: On the tsbench benchmark, structural navigation reduced context overhead by tracking which functions reference which others, so Claude never reads a file without knowing why it's relevant to the current task.
Data sources: Token-Savior GitHub 971 Stars; README "structural code navigation" feature description; tsbench benchmark methodology (https://github.com/Mibayy/tsbench).
Hidden Use #5: The ts init --agent cursor Hook for Non-Claude MCP Agents
What most people do: Use Token-Savior only with Claude Code (its primary target), and assume it doesn't work with Cursor, Windsurf, or Continue.
The hidden trick: The ts CLI exposes Token-Savior's compactor functionality to any agent via shell hooks. The --agent flag auto-generates the Bash profile configuration:
# For Cursor
ts init --agent cursor
# For Windsurf
ts init --agent windsurf
# For Aider
ts init --agent aider
# For Continue
ts init --agent continue
# Output: adds shell functions to ~/.bashrc or ~/.zshrc
# that wrap the agent's Bash calls through ts compact
The CLI daemon mode (ts daemon start) runs at ~145ms per call vs 1.5s for a cold fork — so even the CLI overhead is minimal. For agents that don't have native MCP support (Aider, for example), this is the only way to get Token-Savior's 34 compactors working.
The result: Cursor users report 30-50% reduction in token usage from Bash output compaction alone, even without the MCP server mode. The --agent flag handles the configuration automatically — no manual env var setup needed.
Data sources: Token-Savior README "Bonus: ts CLI for non-MCP agents" section; confirmed support for Cursor, Windsurf, Aider, Continue, and generic scripts/CI.
Summary
Token-Savior is the MCP server that turns any AI coding agent into a more cost-efficient version of itself. Here are the five hidden uses covered today:
-
TS_PROFILE=optimized— One env var unlocks the benchmark-grade compactor registry. 97.9% on tsbench vs 78.3% baseline, at -80% token cost. - 34 Bash compactors — Automatic output compression for grep, git, pytest, find, cat, gh, kubectl, eslint, and more. ~20.4K tokens/week saved on real workloads.
-
ts discover— Scan your transcript history to find which commands are your biggest token sinks and which compactors you're already missing. -
Structural code navigation —
ts get/ts searchgive Claude the call graph of a function without reading its full implementation. Context without bloat. -
ts init --agent cursor— Wire Token-Savior into Cursor, Windsurf, Aider, or Continue via shell hooks. Same compactors, any agent.
Related Articles
If you found this useful, you might also like:
- FastMCP's 5 Hidden Uses for Production Agent Stacks — MCP server patterns that go beyond simple tool exposure
- Goose's 5 Hidden Uses That Turn It Into a Production AI Agent Stack — Self-hosting AI agents with 70+ MCP extensions
- MemPalace's 5 Hidden Uses That Make It the Best Benchmarked AI Memory System — 96.6% R@5 on LongMemEval, 100% with Haiku rerank
Have a hidden use of Token-Savior that nobody's talking about? Share it in the comments — I'd love to hear what's working for you.
Top comments (0)