LeetCode Token Golf – Training for the interviews that matter
LeetCode Token Golf is a browser script that helps users track token usage when using AI models to solve coding problems on LeetCode. It runs directly in the browser via Tampermonkey, connecting to AI providers like OpenAI and Anthropic without sending data to external servers. The tool emphasizes privacy, transparency, and efficiency in AI-assisted coding interview preparation.
- ▪LeetCode Token Golf is a Tampermonkey script that tracks AI token costs for solving LeetCode problems.
- ▪The script communicates directly from the browser to AI providers, ensuring no data is logged or sent to third-party servers.
- ▪It supports AI models from OpenAI and Anthropic, including GPT-4o and Claude 3.5 Haiku/Sonnet.
- ▪API keys are stored locally in the browser using Tampermonkey's isolated storage.
- ▪The project is open source, requires no build step, and is released under the MIT license.
Opening excerpt (first ~120 words) tap to expand
⛳ LeetCode Token Golf Track how many tokens your AI solutions cost. Your API key never leaves your browser. No backend. No logging. No trust issues. Install Install Tampermonkey Click this link Tampermonkey will prompt you to install Visit any LeetCode problem page How It Works Write a prompt in the LeetCode editor Click 🚀 Run with AI The script calls OpenAI/Anthropic directly from your browser Response auto-fills the editor Submit normally through LeetCode The script tracks pass/fail and token usage Why This Exists We taught engineers to optimize for time and space. Now we train them to optimize for tokens. Privacy API keys stored in your browser (Tampermonkey's isolated storage) No prompts or responses are ever sent to any server Direct browser → API calls (no proxy) Open source.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.