Main product · Free · 100% local · Apache-2.0
Prompt Router is the flagship product of TokenCalc AI: a local preflight layer that reads a prompt before it reaches an AI agent, estimates the work, and recommends where the task should run. Nothing is uploaded, the CLI makes no network calls, and routing writes no state.
Prompt Router reads a prompt locally and reports five things before a provider call: a token and cost estimate, the task type, the best agent, a model route with an alternate and an open-weight option, and the estimated savings versus the model you were about to use.
Before a provider call, the route command prints a short summary or a complete JSON object with --json. Each decision is a starting point, not a hard clamp: you can keep the current model, ask your agent to switch, or add caps with policy.
The route table maps task signals to an agent type and three model families. Simple extraction work favours local weights, code and long-form work can move to Claude, research and large-context tasks lean on Gemini, and general agent work can stay on GPT.
| Task signal | Agent | Preferred | Alternate | Open weight |
|---|---|---|---|---|
| Summarize, list, rewrite, translate, extract | local-agent | Qwen 2.5 72B | Gemini 3.8 Flash | Qwen 2.5 72B |
| Implement, refactor, debug, test suite | code-agent | Claude Sonnet 5.5 | GPT-6.1 Sol | Qwen 2.5 72B |
| Research, audit, citations, source comparison | research-agent | Gemini 4 Neon | Claude Opus 5.5 | DeepSeek Flash |
| Math, proof, statistics, reasoning puzzle | reasoning-agent | Gemini 4 Neon | GPT-6 Astra | DeepSeek V4 Pro |
| Brainstorm, story, marketing copy, script | writing-agent | Claude Sonnet 5.5 | GPT-6.1 Sol | Mistral Large 2 |
| Three or more planned tool calls | code-agent | GPT-6.1 Sol | Claude Sonnet 5.5 | Qwen 2.5 72B |
| More than 20,000 context tokens | research-agent | Gemini 4 Neon | Claude Opus 5.5 | DeepSeek Flash |
| Mixed or unclear request | general-agent | GPT-6.1 Sol | Gemini 4 Neon | Qwen 2.5 72B |
node agent-battery-saver/scripts/agent-saver.mjs route \
--prompt-file ./prompt.txt \
--context-file ./context.txt \
--model gpt-6-astra \
--tool edit_file --tool run_testsDownload the bundle from the latest public GitHub release or use a one-line installer. The install directory stays agent-battery-saver/ for compatibility. Set PROMPT_ROUTER_SKILLS_DIR (or OPENCODE_SKILLS_DIR) to install it wherever your agent loads skills; the default remains ~/.config/opencode/skills. Then give the instruction below to any agent that can run a local command. OpenCode catalog support is optional.
agent-battery-saver/SKILL.md as a skill, add it to your system prompt or AGENTS.md, or call the CLI by its local path.curl -fsSL https://raw.githubusercontent.com/vishvaisadev123/agent-battery-saver-skill/main/install.sh | shiwr -useb https://raw.githubusercontent.com/vishvaisadev123/agent-battery-saver-skill/main/install.ps1 | iexUse Prompt Router (agent-battery-saver) before any model call: run route, report the token and cost estimate, use gate's forward payload for the real call, then finish with verified evidence. Never upload prompts, context, responses, or credentials.The one-time catalog or release download is the only network request. After installation the CLI runs offline.
Community feedback
Share what worked, what didn't, and which route you chose. Feedback is published on the public board — please never include prompts, credentials, or private code.
Loading feedback…
Prompt Router separates what stays in your calling app from the small local fields the skill stores in .agent-saver/. Add that directory to your .gitignore if you do not want reports committed.
| Stays in your app | Stored locally in .agent-saver/ |
|---|---|
| Raw prompt text | Hashed prompt and cache keys |
| Retrieved context and documents | Redacted prompt and task summaries |
| Provider responses | Normalized token counts and costs |
| Provider credentials | Model routing, tool names, and retries |
| Full conversation history | Files, tests, commits, outcome and waste scores |
7 short answers — tap a question to expand.
Yes. Prompt Router is Apache-2.0, downloadable without an account from the public GitHub repository, and runs entirely on your own machine.
No. The CLI makes no network requests, and route does not create the local state directory. Raw prompt text, retrieved context, provider responses, and credentials are never written to disk by the skill.
Open-weight families such as Qwen, Llama, Mistral, and DeepSeek, plus Anthropic Claude, Google Gemini, and OpenAI GPT. The choice depends on task type, context size, output cap, and tool count.
No. It uses local pricing data to estimate a route before the call. TokenCalc calculators remain useful for comparing models and understanding token costs after the fact.
Yes. The CLI is plain Node.js with no dependencies, so any agent that can run a local command can use it — Claude Code, Cursor, Codex, Gemini CLI, OpenCode, or a custom agent. Load the bundled SKILL.md, add the one-line instruction to your agent prompt, or call the CLI directly. OpenCode catalog support is optional.
Use the public feedback section on this page. Clicking Download opens the GitHub release in a new tab and expands the feedback form when you return. Share your name, a short title, and your experience; never include prompts, credentials, or private code.
Yes. After downloading, you can opt in to browser notifications. One day later you will get an on-page prompt when you return and, if the tab is open and permission was granted, a desktop notification. Only a timestamp is stored in your browser; no prompt content is sent anywhere.