r/ClaudeCode • u/nexxismyname • 9h ago
Discussion I upgraded TokenMS (open-source local MCP server) to cut coding agent token usage & protect prompt caches — looking for testers!
Hey everyone,
If you've been burning through your AI coding quotas way too fast (especially hitting 5-hour or weekly limits on Antigravity, Cursor, or Claude Desktop), I built and just pushed a major update to TokenMS — an open-source, local MCP server designed to filter out codebase noise before it ever hits your LLM.
GitHub:https://github.com/harshnexx/tokenms
What it is
TokenMS sits locally between your coding agent and your repositories. Instead of letting the agent read entire files, run noisy git grep loops, or dump 5,000-line test logs into the context window, TokenMS indexes your codebase locally and serves only the exact symbols and context needed.
How it works under the hood
- Prefix-Stable Context Assembly: Splits context into a deterministically sorted static prefix (repo map + outlines) and an append-only suffix so your provider's online KV/prompt cache stays warm across turns.
- Minimal Core Tool Surface: Exposes only 7 core tools by default (in deterministic alphabetical order) and routes secondary tools on-demand via
discover_tools+dispatch, cutting the per-turn schema "tools tax." - SQLite Delta Ledger & Loop Guard: Tracks which symbols were already sent in the current session so unchanged code isn't re-sent, and detects when an agent is stuck retrying the same failing action.
- Compact Wire Format (TOON + Minified JSON): Strips unnecessary JSON formatting and uses Token-Oriented Object Notation (TOON) for tabular data to shrink tool payloads.
- Universal Async Job Runner & Log Distiller: Runs long test/build scripts in the background and distills raw stdout/stderr down to a <400-token failure summary with inline source snippets.
- Multi-Project Isolation: One global MCP server handles all your local repos (Python, Rust, Dart/Flutter, JS/TS, SQL/Supabase) with isolated SQLite workspaces.
In my own daily usage, this update dropped my normal quota burn by roughly 40–50% with no drop in coding accuracy.
Looking for testers & feedback
It's completely free and open-source. I'd love for you to plug it into Antigravity, Cursor, or Claude Desktop and put it through real-world projects.
If you run into any bugs, edge cases, setup friction, or have ideas to squeeze out even more token savings, please drop a comment here or open an issue on GitHub. Thanks for checking it out!
•
u/AutoModerator 9h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.