tokenhud
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tokenhudam I close to my 5-hour limit? wait for the reset if so"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tokenhud
A live terminal heads-up display for your coding-agent usage: Claude Code and Codex subscription limits per account, cost history, and an MCP server so agents can check their own limits and wait for a reset instead of failing mid-task.
Status: early development. Nothing is usable yet. tokenhud is the TypeScript (Bun) successor to cc-usage, which is now frozen. When tokenhud ships, it will import cc-usage's usage history.
Use with Claude Code
tokenhud's MCP server lets a Claude Code agent check the limits of the account it runs
on, decide whether to pause, and wait for a reset. That matters most for sessions that
can't resume on their own: claude -p, background tasks and teammates. Interactive
Claude Code resumes by itself after a reset, so there an agent should tell you instead of
waiting.
Install
Install tokenhud first, so tokenhud is on the PATH Claude Code starts with: the plugin
and the MCP server both run tokenhud mcp. Otherwise /mcp in Claude Code shows the
server as failed.
Plugins and user-scope MCP servers belong to one Claude config dir, so install once per
account: once for ~/.claude, and once more for each CLAUDE_CONFIG_DIR you use.
tokenhud doctor shows which accounts have it, and whether tokenhud is on the PATH.
The plugin adds the MCP server and a skill that tells agents when to use it:
claude plugin marketplace add ZhuoQiuMcgill/tokenhud
claude plugin install tokenhud@tokenhud
# another account
CLAUDE_CONFIG_DIR=~/.claude-work claude plugin marketplace add ZhuoQiuMcgill/tokenhud
CLAUDE_CONFIG_DIR=~/.claude-work claude plugin install tokenhud@tokenhudThe MCP server on its own:
claude mcp add -s user tokenhud -- tokenhud mcp
CLAUDE_CONFIG_DIR=~/.claude-work claude mcp add -s user tokenhud -- tokenhud mcpNative Windows: an npm install puts a tokenhud.cmd shim on the PATH, which Claude
Code can't start directly. Register the server through cmd instead of installing the
plugin: claude mcp add -s user tokenhud -- cmd /c tokenhud mcp. The standalone
tokenhud.exe (installed with install.ps1) works directly, plugin included.
Tools
Tool | What it does |
| The account's limit windows (5-hour, weekly, per model): utilization from 0 to 1, reset time, spend pace, and when the window would run out at that pace (an estimate). Fetches fresh limits when the cached ones are over 60 s old. |
|
|
| Waits until the window |
| Tokens and API-equivalent cost for a period, optionally by model, account, day, week or month (at most 500 groups per call), as |
| The accounts on this machine, from cached data only: whether their limits can be read here ( |
Every tool answers for the account the session runs on: CLAUDE_CONFIG_DIR, else
~/.claude, confirmed by finding the session's transcript. limits reports how it was
found (detected_via). Pass account (a label from accounts) for another account, or
provider: "codex" for Codex. An account that isn't signed in on this machine reports
signed_in: false, and should_wait doesn't make agents wait on it.
Related MCP server: mcp-token-saver
Development
Prerequisite: Bun 1.4.2 or later. CI pins 1.4.2; Bun 1.3.12 and 1.4.0 produced macOS binaries with broken signatures.
bun install # the MCP SDK (the one runtime dependency) and dev tooling
bun run check # typecheck (tsc), lint and format check (Biome), tests (bun test)
bun run build # standalone binary for this machine at dist/tokenhudtokenhud json output for scripts and agents is documented in
docs-public/JSON.md (schema 1).
bun run format rewrites files in the project style. bun run build --target=<bun target>
cross-compiles; for example, --target=bun-windows-x64 writes dist/tokenhud.exe.
Repository layout:
src/cli.ts entry point: parses arguments and dispatches commands
src/version.ts the version, taken from package.json at build time
src/commands/ one module per subcommand: json, mcp, doctor, import-cc-usage
src/mcp/ the MCP server: account detection, the tools, waiting for a reset
src/query/ the query layer: periods, totals and groupings, priced to the cent
src/store/ the SQLite usage store and its hourly rollup
src/pricing/ the dated price table and the cost engine
test/ bun test suites; they run the CLI in a subprocess
scripts/build.ts wrapper around bun build --compile
plugin/ the Claude Code plugin (listed by .claude-plugin/marketplace.json)License
This server cannot be deployed
Maintenance
Related MCP Connectors
Meter, cap, and block AI agent spend before the provider is charged.
Track, analyze, and act on your streaming and SaaS subscriptions from any AI agent.
Budget & cost control for AI agents — per-agent spend caps + rate limits before each call.
Token guard and rate limiter preventing runaway API cost spikes for OpenAI and Anthropic.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceProvides real-time visibility into Claude Pro and Max subscription usage limits directly within Claude Code by utilizing local OAuth tokens. It enables users to monitor session and weekly usage across different models and receive alerts regarding rate-limiting status.4-
- AlicenseAqualityCmaintenanceReal-time Claude.ai subscription awareness for AI coding assistants. Surfaces live utilization, forecasts limits, gates expensive operations, and measures real per-task cost.517 npm6MIT
- AlicenseNot gradedqualityCmaintenanceSurface Claude Code token usage, estimated cost, and plan-limit status in any MCP client. Enables agents to query usage data from local logs and Anthropic API.MIT
- AlicenseNot gradedqualityCmaintenanceProvides coding agents with pre-flight cost estimation by analyzing local logs to forecast token usage and quota impact before expensive work, exposing tools for remaining quota, per-task cost estimates, and attempt affordability.154 npmMIT