npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

token-alerts

v0.2.0

Published

Track daily Claude, Codex, and Gemini spending against a configurable dollar limit with status bar display and alerts

Readme

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.

VS Code


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