AI Cost Tracker
Track your daily Claude, Codex, and Gemini spending right from the VS Code status bar. Set independent budget limits per provider, get threshold alerts, and manage everything from a built-in dashboard — no digging through VS Code settings.

Features
Status Bar at a Glance
A persistent status bar item shows your combined spend vs total budget. The background turns yellow at the warning threshold and red at the critical threshold — based on whichever provider is closest to its limit.
Per-Provider Budget Limits
Each provider gets its own independent daily dollar limit. Claude, Codex, and Gemini are tracked and alerted separately — no shared pool.
Threshold Alerts
Configurable warning (default 80%) and critical (default 95%) notifications fire independently per provider. A final alert fires when any provider exceeds 100%.
Live Dashboard with Built-in Settings
Run AI Cost Tracker: Show Dashboard from the command palette to open a full webview:
- Hero section — combined spend, total budget, and progress bar
- Provider cards — each provider shows spend vs its own limit, progress bar, token count, remaining budget, and an inline editable Daily Limit input
- Stats row — total spent, total remaining, and average cost per hour
- Cost breakdown — stacked bar and detail rows for input, output, cached input, and cache write costs
- Settings panel — edit warning threshold, critical threshold, and polling interval directly in the dashboard
All settings changes are saved instantly (debounced) with a green flash confirmation. No need to open VS Code settings — everything is managed from the dashboard UI.
Automatic Refresh
- File watcher — detects new usage the moment log files change
- Polling — configurable interval (default 30 s) as a fallback
- Midnight reset — counters reset automatically at the start of each day
How It Works
The extension reads local log files that AI coding assistants write to disk:
| Provider |
Path |
Format |
| Claude |
~/.claude/projects/**/*.jsonl |
JSONL with assistant messages |
| Codex |
~/.codex/sessions/YYYY/MM/DD/*.jsonl |
JSONL with token_count events |
| Gemini |
~/.gemini/tmp/**/chats/*.json |
JSON with messages array |
Costs are calculated using a built-in pricing table covering current models:
| Family |
Models |
| Claude |
Opus 4/4.1, Sonnet 4/4.6/3.7/3.5, Haiku 3/3.5 |
| OpenAI |
GPT-5/5.1/5.4 (incl. mini/nano), Codex Mini |
| Gemini |
3 Pro/Flash, 2.5 Pro/Flash |
Unknown models fall back to Sonnet-tier pricing.
No network requests. Everything is parsed locally from files already on your machine.
Settings
All settings can be edited directly from the dashboard UI. They are also available in VS Code settings under the tokenAlerts namespace.
Budget Limits (per provider)
Configured inline on each provider card in the dashboard.
| Setting |
Default |
Description |
tokenAlerts.claudeDailyCostLimit |
5 |
Daily spending limit in USD for Claude |
tokenAlerts.codexDailyCostLimit |
5 |
Daily spending limit in USD for Codex |
tokenAlerts.geminiDailyCostLimit |
5 |
Daily spending limit in USD for Gemini |
The combined budget shown in the hero section is the sum of all three provider limits.
Alert Thresholds & Polling
Configured in the Settings panel at the bottom of the dashboard.
| Setting |
Default |
Description |
tokenAlerts.warningThreshold |
80 |
% of a provider's limit to trigger a warning |
tokenAlerts.criticalThreshold |
95 |
% of a provider's limit to trigger a critical alert |
tokenAlerts.pollingIntervalMs |
30000 |
How often to refresh usage data (ms) |
Advanced (VS Code settings only)
These are not exposed in the dashboard and must be set via VS Code settings if needed.
| Setting |
Default |
Description |
tokenAlerts.claudeConfigPath |
(empty) |
Override path to .claude directory |
tokenAlerts.codexConfigPath |
(empty) |
Override path to .codex directory |
tokenAlerts.geminiConfigPath |
(empty) |
Override path to .gemini directory |
Commands
| Command |
Description |
AI Cost Tracker: Show Dashboard |
Open the spending dashboard with inline settings |
AI Cost Tracker: Reset Alert Notifications |
Dismiss all fired alerts so they can re-trigger |
Installation
From VSIX
code --install-extension token-alerts-0.2.0.vsix
From Source
git clone <repo-url>
cd token-alerts
npm install
npm run compile
# Then press F5 in VS Code to launch the Extension Development Host
Requirements
- VS Code 1.85 or later
- At least one of: Claude Code, Codex CLI, or Gemini CLI installed (so their log files exist)
License
MIT