claude-token-saver
Supports GitHub Models as an optional free LLM provider for delegated generation, though it is currently skipped because the endpoint returns a non-JSON response.
Delegates heavy code and text work to Gemini models via Google AI Studio's free tier, with automatic model discovery, routing, and fallback.
Supports NVIDIA NIM as an optional free LLM provider for delegation, with automatic pause when unavailable or payment-required.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-token-saver Summarize logs/app.log and save the summary to summary.md"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
πͺ claude-token-saver
Make your Claude Code plan go further. Claude plans and checks the work. Free LLM APIs do the heavy, token-hungry part.
Claude Code is great, but long generations (new modules, test suites, translations, docs) and reading huge files burn through your usage limit quickly. Plenty of strong models are available for free through API free tiers: Gemini, DeepSeek, Qwen, Kimi, GLM, GPT-OSS, Llama, Mistral and more.
claude-token-saver is an MCP server that gives Claude Code four new tools. With them, Claude can hand the heavy work to the best free model available today, have a model from a different family review the result, and spend its own tokens only on the final check.
You βββΊ Claude Code (plans, decides, verifies)
β delegate / delegate_checked / review
βΌ
claude-token-saver ββ reads files from disk, masks secrets, picks today's best free model
β
βββΊ Gemini (AI Studio) βββΊ OpenRouter :free βββΊ Groq
βββΊ optional: Cerebras, NVIDIA NIM, Mistral, SambaNova, GitHub Models
β²
model A drafts β model B (other family) reviews β A fixes β B re-checksβ¨ Features
Daily auto-discovery. On the first call of each day it asks every provider which models are free today, reads the live limits your keys report and rebuilds the routing table. When a model is renamed, removed or added, nothing breaks.
Smart routing per task.
code,text,summarize,review,reasoningandgeneraleach get the strongest fitting model. Coder models handle code, million-token-context models handle huge files, reasoning models handle logic.Automatic fallback. If a model is rate-limited, over its daily quota, too small for the prompt or failing, the next best one is tried, preferring other providers. Cooldowns are remembered.
Cross-checking built in.
delegate_checkedruns a draft β independent review β fix β re-review loop, so you get a stabilized answer and a PASS/FAIL verdict.Files never touch Claude's context. Claude passes file paths; the server reads them from disk. With
save_to, generated code goes straight to a file, so Claude never re-types it.Secrets stay home. Values in
.envfiles, private keys, API tokens (OpenAI, GitHub, Google, Groq, Stripe, AWS, Slack, Telegramβ¦), JWTs and DB passwords are masked before anything is sent. Variable names stay, so models can still write code that uses them.Zero cost. Only free tiers are used. No new subscriptions.
Related MCP server: io.github.bdbais/routeai
π How much does it save?
Your Claude tokens go to three things: thinking/writing (most expensive), reading (cheaper) and briefs (short). Delegation moves most of the writing and the bulk reading to free models. These numbers are rough estimates, not benchmarks; your results depend on the task.
Task | Typical Claude-token saving |
Large new code (module, page, test suite) | 50β70% |
Reading / summarizing big files, logs, docs | 60β80% |
Long text, translation, marketing copy | 50β70% |
Medium change across 2β3 files | 10β30% |
Hard debugging, architecture decisions | ~0% (Claude does it itself) |
One-line fix | negative (Claude does it itself) |
Mixed day-to-day work | ~40β50% |
What that means for your plan:
Pro: your 5-hour and weekly limits stretch noticeably further, because the biggest consumer (long generations) moves to free models.
Max: heavy agentic sessions run longer before you hit limits, or you can work in more projects at once.
API / pay-as-you-go: fewer output tokens means a smaller bill.
π Quick start
1. Get free keys. These three are free with no credit card, and they cover everything:
Provider | Free tier highlights | Get a key | Env var |
Google AI Studio | Gemini Flash models with a 1M-token context, ideal for big files and text. Pro models are not in the free tier; the tool skips them automatically. |
| |
OpenRouter | All |
| |
Groq | Very fast GPT-OSS-120B, Qwen, Llama. Small tokens-per-minute cap, so big prompts go to the other providers automatically. |
|
Optional providers are supported, but as of November 2026 each one has a catch:
Provider | Status | Env var |
Cerebras | Asks for a payment card to unlock a one-time $5 credit (30 days). |
|
NVIDIA NIM | Free developer access, but sign-up is not available in every country. |
|
Mistral | API access on the Free plan now needs pay-as-you-go billing. The key alone returns HTTP 402. |
|
SambaNova | Most models return |
|
GitHub Models | The endpoint currently answers a plain |
|
If you add a key for a provider that turns out to need billing, nothing breaks. The tool sees the 402 or "payment required" answer, pauses that provider and keeps using the others.
Free tiers change often. That's why the tool discovers models and limits every day instead of hard-coding them, and why
claude-token-saver testtells you exactly which keys work today.
2. Initialize. This needs Node.js 18+.
npx -y github:nedcas69/claude-token-saver initThis creates ~/.claude-token-saver/keys.env, where you paste your keys, and installs a Claude Code skill that teaches Claude when delegating pays off.
3. Register it with Claude Code (once, for all projects):
# macOS / Linux
claude mcp add token-saver --scope user -- npx -y github:nedcas69/claude-token-saver
# Windows
claude mcp add token-saver --scope user -- cmd /c npx -y github:nedcas69/claude-token-saver4. Check your keys:
npx -y github:nedcas69/claude-token-saver testRestart Claude Code and ask: "show me today's free models". From then on, Claude delegates automatically when it makes sense, or you can ask explicitly: "generate the tests with delegate_checked".
π§° Tools Claude gets
Tool | What it does |
| One free model does a self-contained task. Options: |
| Draft by model A β review by a model of a different family β fix β re-review (up to |
| 1β3 independent reviewers (different families) check files or a diff. Returns only verdicts and issue lists, so it is cheap to read. |
| Today's providers, model counts, live limits and the routing table. |
Illustrative example of what Claude sees after a delegated generation:
FINAL STATUS: PASS
[draft by openrouter/qwen/qwen3-coder:free Β· 3,912β2,488 tok Β· 21.4s]
[review by gemini/gemini-2.5-flash Β· 6,540β212 tok Β· 4.1s] β FAIL
[fix by openrouter/qwen/qwen3-coder:free Β· 6,830β2,530 tok Β· 19.8s]
[review by gemini/gemini-2.5-flash Β· 6,600β18 tok Β· 2.2s] β PASS
Saved 214 lines (7,904 chars) to src/api/orders.test.ts. Read or diff it before relying on it.Claude read about 90 tokens instead of writing about 2,500.
π₯οΈ CLI
claude-token-saver init # keys file + skill + setup command
claude-token-saver test # ping every configured provider
claude-token-saver status [--refresh] # today's catalog and routing
claude-token-saver ask "prompt" --kind code [--checked](Use npx -y github:nedcas69/claude-token-saver <command> if you haven't installed it globally.)
βοΈ Configuration (optional)
~/.claude-token-saver/config.json:
{
"disabledProviders": ["nvidia"],
"excludeModels": ["llama-3.1-8b"],
"pin": { "code": "qwen3-coder", "summarize": "gemini-2.5-pro" },
"timeoutMs": 180000
}Keys can also come from real environment variables, which take precedence over keys.env. Set CTS_HOME to move the data directory.
π Privacy and security
Your keys live only in
~/.claude-token-saver/keys.envon your machine.Before sending, the server masks secret values:
.env*files (except.env.example), private-key files, common token formats,password=/apiKey:style assignments and passwords in connection strings. Names are kept.Free tiers may use your prompts to train or improve models (Google AI Studio's free tier says so, and some OpenRouter free endpoints log prompts). Don't use it on code you aren't allowed to share with third parties.
Masking is pattern-based and best-effort. It is not a guarantee.
β FAQ
Does Claude get worse? No. Claude still plans, decides and verifies. Free models only do work Claude would otherwise type out, and Claude checks the results (tests, lint, reading the diff).
What if all free models are busy? The tool says so and Claude simply does the task itself.
Does it work with the free Claude plan? It works with any plan that includes Claude Code, and with API billing. The tighter your limits, the more it helps.
A provider asks for my card. Should I add it? No need. Gemini, OpenRouter and Groq work without one. Providers that need billing are paused automatically.
Is this affiliated with Anthropic, Google, OpenRouter� No. This is an independent open-source project.
π οΈ Development
git clone https://github.com/nedcas69/claude-token-saver
cd claude-token-saver
npm install
npm test
node bin/cli.js statusThe code is plain modern JavaScript (ESM, no build step):
src/catalog.js: daily discoverysrc/router.js: model scoring and routingsrc/client.js: calls and fallbacksrc/secrets.js: maskingsrc/tools.js: the four toolssrc/server.js: the MCP server
PRs are welcome, especially new free providers. Any OpenAI-compatible endpoint can be added in src/providers.js.
π License
MIT Β© nedcas69
Available Tools
4 toolsdelegateA
Hand a self-contained, token-heavy task to the best FREE external LLM (Gemini, DeepSeek, Qwen, Kimi, GPT-OSS, Llama... via free API tiers) and get its result. Use it for bulk generation: new files/modules, boilerplate, tests, translations, long text, summaries of big files. Do NOT use it for tiny edits (cheaper to do yourself) or for decisions that need your full understanding of the repo. Always verify the result.
Inputs: task (required), kind, files, model, +4 more.
delegate_checkedA
Like delegate, but self-verifying: model A drafts, a model from a DIFFERENT family reviews it, A fixes the issues, the reviewer re-checks (up to rounds fix cycles). Returns the final answer plus FINAL STATUS (PASS/FAIL/UNREVIEWED) and any open issues. Use for important generated code or text, so you only spend tokens on a final check.
Inputs: task (required), kind, files, model, +4 more.
free_modelsA
Show today's free providers, model counts, live rate limits and which model handles each kind of task. The catalog refreshes automatically once a day; pass refresh=true to force it.
Inputs: refresh.
reviewA
Get 1-3 independent second opinions from free models (different families) on files or text β e.g. code you just wrote. Returns only VERDICT + a short issue list per reviewer, so it is cheap for you to read.
Inputs: text, files, focus, reviewers.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 4 tools
Each tool has a reasonably clear lane: free_models is discovery, delegate is raw offload, delegate_checked adds a review loop, and review returns only verdicts. The main risk is delegate vs delegate_checked vs review, which all involve multiple free models and could be confused, but the descriptions give usable triggers (bulk generation vs important output vs second opinions).
All names are lowercase snake_case, and delegate/delegate_checked follow a predictable base-plus-variant pattern. Minor deviations exist (free_models is a noun resource rather than a verb, and review is a bare verb), but the set remains readable and predictable.
Four tools is on the lean side but fits a narrow, single-purpose server: catalog lookup, basic delegation, verified delegation, and review. Each tool maps to a distinct workflow rather than being filler, though a fifth capability (e.g. job status) would not feel bloated.
The surface covers the full loop of discovering free models, delegating, verifying, and getting independent review, which matches the stated domain well. Gaps are secondary: no async/long-running job tracking, no cancellation or result retrieval, and no visibility into token savings or usage.
Maintenance
Related MCP Connectors
Multi-brand AI code review for Claude: up to 12 reviewers and a judge, no install.
Your AI apps as one team: hand work to Codex or Claude Code on your Mac, with a shared logbook.
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Chief of Staff, strategy and writing tools that give your Claude subscription structure and memory.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables Claude to delegate coding tasks to local Ollama models, reducing API token usage by up to 98.75% while leveraging local compute resources. Supports code generation, review, refactoring, and file analysis with Claude providing oversight and quality assurance.1127AGPL 3.0
- AlicenseAqualityCmaintenanceEnables Claude Code to offload small coding tasks to local Ollama machines and free or paid AI providers, choosing the cheapest available option while enforcing quotas, budgets, and Claude's final review.11MIT
- FlicenseNot gradedqualityAmaintenanceEnables Claude Code and other MCP clients to hand bounded work such as code review, boilerplate generation, commit messages, format conversion and embeddings to a local GPU model, LiteLLM router, OpenRouter, or cheaper cloud API like OpenAI, DeepSeek, Groq or Cerebras. Keeps the orchestrating model as architect and reviewer, cutting token spend and providing a second opinion on code.-
- AlicenseNot gradedqualityAmaintenanceLets Claude Code or any MCP client hand bounded work such as code review, boilerplate generation, commit messages, and format conversion to a local GPU model, an OpenAI-compatible cloud API, or a LiteLLM/OpenRouter router, so those files never enter the orchestrator's context window. This cuts token cost by roughly 93% on read-heavy tasks and provides a second model for reviewing code, while the main AI platform keeps the planning and judgement calls.MIT