Ever wonder how many tokens you're burning in a Claude Code session? I kept hitting Claude Code's context limit mid-session with no warning, so I built a browser extension that shows your token usage in real time.
Context window usage, token counts, cache stats, all sitting in your toolbar while you work.
- Python 3.9+
- JavaScript
- Chrome Extension (with Native Messaging)
- Clone or download this repo
- Open
chrome://extensions - Turn on Developer mode (top right)
- Click Load unpacked and select the
extension/folder - Copy the extension ID from the card that appears — it is a 32-character string like
abcdefghijklmnopqrstuvwxyz123456shown under the extension name
The extension can't read your local files directly (browser security), so it talks to a small Python script running in the background. Takes 30 seconds to set up.
macOS / Linux:
git clone https://github.com/akakarantzas/claude-code-counter
cd claude-code-counter
bash scripts/install-mac-linux.sh --extension-id YOUR_EXTENSION_IDWindows:
setup.batOr pass the extension ID directly:
setup.bat YOUR_EXTENSION_IDYou can also run the PowerShell installer directly:
git clone https://github.com/akakarantzas/claude-code-counter
cd claude-code-counter
.\scripts\install-windows.ps1 -ExtensionId YOUR_EXTENSION_IDThat's it. Click the icon in your toolbar and you'll see your token usage update every 2.5 seconds.
| Metric | Description |
|---|---|
| Context window | How full your context is (avg tokens per turn vs 200k limit) |
| Session tokens | Input, output, and total for the whole session |
| Prompt cache | How much of your input is being served from cache |
| Activity | Turn count, tool calls, how long the session has been running |
Claude Code saves every session as a .jsonl file in ~/.claude/projects/. Each turn has a usage block with exact token counts straight from the API. The Python script reads the latest session file and passes the data to the extension using Chrome's Native Messaging API. No network requests, no accounts, nothing leaves your machine.
- Python 3.9+
- Chrome 88+
- Claude Code
macOS / Linux:
bash scripts/uninstall-mac-linux.shWindows:
uninstall.batOr run the PowerShell uninstaller directly:
.\scripts\uninstall-windows.ps1Then remove the extension from chrome://extensions.
MIT