Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By tschallackav1.0.0MITIn 1 marketplace
Always-visible Claude Code usage limits in your shell prompt, iTerm status bar and Claude Code statusline. One background fetcher, many zero-cost readers, plus CSV history for charting.
You run one by typing its /name in Claude Code.
1 caution to review before installing
A command runs shell commands (! syntax) when you invoke it
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude Code usage limits in your bash prompt, your iTerm status bar, and Claude Code's own statusline — plus a CSV history you can chart later.
4h25m [█░░░░░░░░░] 9% · 6d 14h [██▌░░░░░░░] 25% you:~/code/thing$
Each bar is coloured by its own percentage, so a hot 7-day window is visible
while the session is still green. Both blocks are labelled with the time left
until they reset rather than a flat 5h / 7d. The 5h window is short enough
to be worth the minutes (4h25m); the 7d one is deliberately coarse - 6d 14h,
then 14h, dropping to minutes only inside the last hour - so a week-long label
does not reflow every 60 seconds. Set CLAUDE_USAGE_STYLE=text for
the original one-line form, 5h 7% · 7d 24% · Opus 55%.
PS1The usual recipe fetches once per prompt render. With a dozen iTerm tabs that is a dozen HTTPS round trips per keystroke-return, a visible stall on every prompt, and a fast track to HTTP 429. This plugin splits the two jobs:
| who | cost | |
|---|---|---|
| fetch | one background poller, once per minute, whole machine | 1 request/min |
| display | every prompt, reading one small cache file | no network, no fork |
Three independent gates keep the request count at exactly one per minute no matter how many terminals you open and close:
~/.cache/claude-usage/heartbeat
(a shell builtin, no fork). If no prompt has been drawn for 5 minutes the
fetcher exits without calling the API. Closed terminals cost nothing.current.json is younger than CLAUDE_USAGE_INTERVAL,
the fetcher exits immediately.mkdir is atomic, so of 40 simultaneous fetchers exactly one
proceeds. (Verified in tests/run-tests.sh: 30 concurrent cold fetches → 1
API call.)Because of gates 2 and 3 the plugin is correct without any scheduler at all — a shell that notices stale data starts one background refresh. The launchd / systemd timer just keeps the numbers current while you sit idle.
curl -fsSL https://raw.githubusercontent.com/tschallacka/claude-usage/main/install.sh | bash
That clones the repo to ~/.local/share/claude-usage-plugin, installs the
prompt segment and poller, and registers the Claude Code plugin so you get
/claude-usage:status, :chart and :doctor. Re-run it to update.
Piping a script into your shell is a lot of trust to extend to a stranger, so
read it first if you would rather not: it is
install.sh, about 60 lines, and everything it touches lives under
$HOME. Flags: --no-scheduler, --no-bashrc, --no-plugin.
git clone https://github.com/tschallacka/claude-usage.git
./claude-usage/scripts/install.sh
claude plugin marketplace add tschallacka/claude-usage
claude plugin install claude-usage@claude-usage
The installer requires git, jq and curl, and it:
~/.local/bin/claude-usagecrontab if neither, nothing if you pass --no-scheduler~/.bashrcmacOS, important: the first fetch triggers a Keychain prompt for
Claude Code-credentials. Click Always Allow, otherwise the background
launchd job will sit there blocked forever. Running the installer from a
terminal (not from a background context) is what gets you that dialog.
Open a new terminal, or . ~/.bashrc.
usage | current numbers and reset times |
usage-now | force a refresh, then print them |
claude-usage doctor | why isn't it updating |
claude-usage chart --text | sparklines + per-block burn rate |
claude-usage chart --open | PNG (needs pip install matplotlib) |
claude-usage line --plain | one uncoloured line, for other status bars |
Inside Claude Code: /claude-usage:status, :chart, :doctor, :install,
:uninstall.
bash cannot repaint an idle prompt — there is no zsh TRAPALRM equivalent — so
the prompt segment updates whenever a new prompt is drawn. That covers the
"always visible" half of the ask. For a number that ticks on its own while you
sit idle, you need something other than PS1:
iTerm2 (this is the real answer on macOS). Its status bar re-runs a component on its own cadence:
mkdir -p ~/Library/Application\ Support/iTerm2/Scripts/AutoLaunch
cp ~/.local/share/claude-usage-plugin/extras/iterm2-statusbar.py \
~/Library/Application\ Support/iTerm2/Scripts/AutoLaunch/
npx claudepluginhub tschallacka/claude-usage --plugin claude-usageBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground