Skip to main content
Glama

πŸͺ™ 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.

License: MIT Node MCP Providers


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, reasoning and general each 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_checked runs 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 .env files, 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.

aistudio.google.com/apikey

GEMINI_API_KEY

OpenRouter

All :free models: DeepSeek, Qwen, Kimi, GLM, Nemotron, Llama… Shared daily cap on free requests.

openrouter.ai/keys

OPENROUTER_API_KEY

Groq

Very fast GPT-OSS-120B, Qwen, Llama. Small tokens-per-minute cap, so big prompts go to the other providers automatically.

console.groq.com/keys

GROQ_API_KEY

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).

CEREBRAS_API_KEY

NVIDIA NIM

Free developer access, but sign-up is not available in every country.

NVIDIA_API_KEY

Mistral

API access on the Free plan now needs pay-as-you-go billing. The key alone returns HTTP 402.

MISTRAL_API_KEY

SambaNova

Most models return PAYMENT_METHOD_REQUIRED without a card on file.

SAMBANOVA_API_KEY

GitHub Models

The endpoint currently answers a plain OK instead of JSON, so it is skipped until GitHub fixes it.

GITHUB_MODELS_TOKEN

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 test tells you exactly which keys work today.

2. Initialize. This needs Node.js 18+.

npx -y github:nedcas69/claude-token-saver init

This 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-saver

4. Check your keys:

npx -y github:nedcas69/claude-token-saver test

Restart 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

delegate

One free model does a self-contained task. Options: kind, files, save_to, model, max_tokens.

delegate_checked

Draft by model A β†’ review by a model of a different family β†’ fix β†’ re-review (up to rounds). Returns FINAL STATUS: PASS/FAIL plus open issues.

review

1–3 independent reviewers (different families) check files or a diff. Returns only verdicts and issue lists, so it is cheap to read.

free_models

Today's providers, model counts, live limits and the routing table. refresh: true forces discovery.

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.env on 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 status

The code is plain modern JavaScript (ESM, no build step):

  • src/catalog.js: daily discovery

  • src/router.js: model scoring and routing

  • src/client.js: calls and fallback

  • src/secrets.js: masking

  • src/tools.js: the four tools

  • src/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 tools
delegateA

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

    A3.9/5.0

    Scored across 4 tools

    Disambiguation4/5

    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).

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables 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.
      11
      27
      AGPL 3.0
    • A
      license
      A
      quality
      C
      maintenance
      Enables 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.
      11
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables 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.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Lets 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