Token Saver
A Chrome extension that analyzes AI prompts for token efficiency across ChatGPT, Claude, and Gemini โ helping users reduce costs and write better prompts.
The Problem
AI tools charge by the token. Most users have no idea how many tokens their prompts use, whether they're being efficient, or how much they're spending. Verbose prompts waste money and often produce worse results than concise ones.
There was no simple tool that sat inside the browser and gave real-time feedback on prompt quality before you hit send.
The Solution
Token Saver is a Chrome extension that analyzes prompts in real-time as you type. It counts tokens using the same tokenizer OpenAI uses (tiktoken), scores efficiency, identifies waste, and offers one-click optimization โ either rule-based or GPT-powered rewrites.
It works across ChatGPT, Claude, and Gemini without any configuration. Just install and start writing better prompts.
Key Features
Real-Time Token Counting
See exactly how many tokens your prompt uses as you type, powered by js-tiktoken โ the same tokenizer OpenAI uses internally.
Efficiency Scoring
Get a score from 0-100 based on token density, redundancy, and clarity. See exactly where your prompt is wasting tokens.
One-Click Optimization
Optimize prompts instantly with rule-based compression or optional GPT-powered rewrites that maintain meaning while reducing tokens.
Analysis History
Track your prompt efficiency over time with Chrome storage-based history. Export and import analysis data for record-keeping.
Architecture & Technology
Manifest V3
Latest Chrome extension standard
Webpack
Module bundling and build optimization
js-tiktoken
OpenAI's tokenizer running client-side
OpenAI API
Optional GPT-powered prompt rewrites
Jest
Full test suite for reliability
Chrome Storage
Local analysis history with export/import
The Build Journey
Token Saver started as a weekend tool and grew into something useful.
Tokenizer in the Browser
Got js-tiktoken working client-side inside a Manifest V3 extension. Real-time token counting as the user types in the popup. No backend.
Efficiency Scoring
Built a scoring engine that looks at token density, redundancy, and filler words to produce a 0-100 efficiency score โ with callouts for the specific phrases wasting tokens.
One-Click Optimization
Rule-based prompt compression plus optional GPT-powered rewrites. The user keeps control โ rewrites are suggestions, not auto-applied.
Live Demo + Distribution
Exported a standalone demo on GitHub Pages so anyone can try it without installing. Added analysis history and import/export via Chrome storage.
Key Technical Challenges
Running OpenAI's tokenizer client-side
Accurate token counts require the exact tokenizer the model uses โ not a rough estimate. We bundled js-tiktoken through Webpack, trimmed the encoder tables to what we actually need, and cache the encoder across popup opens so counting stays instant even on long prompts.
Manifest V3 constraints
Chrome's new extension manifest killed a lot of the patterns older extensions relied on โ persistent background pages, remote code, and permissive CSP are all gone. We restructured around service workers, local-only computation, and an explicit opt-in for any API-backed feature so the extension stays auditable.
Keeping the UI honest about costs
Token counts only matter if users believe them. We added visible source notes (which tokenizer, which model mapping), reproducible scoring, and a full test suite with Jest so every rule in the efficiency engine has a regression test. No magic numbers.
Security & Reliability
Local-First Computation
Token counting and scoring run entirely on-device โ no prompt ever leaves the browser unless the user opts into GPT rewrites
Minimal Permissions
Only the Chrome permissions strictly required โ no broad host access, no page-content scraping
User-Owned API Key
Optional GPT features use the user's own OpenAI key, stored in Chrome's encrypted storage
Full Test Coverage
Jest test suite covers scoring, tokenization, and storage layer โ every release is regression-tested
Try It Yourself
Token Saver has a live demo you can try right now โ no installation needed.
Try Live Demo →Services Behind This Build
Need a Chrome Extension or Developer Tool?
We build browser extensions, developer tools, and productivity software. Tell us what you need.
Get a Free Consultation