claudeers.

🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?

Claim this page →
// DevOps & CI/CD

tmux-claude-usage

Claude usage in tmux status bar

// DevOps & CI/CD[ api ][ web ][ claude ]#claude#claude-code#tmux#devopsMIT$open-sourceupdated about 4 hours ago
// install
git clone https://github.com/docker-run/tmux-claude-usage

demo

Your Claude usage — progress bar, percent, and reset time — right in the tmux status bar. It uses the official usage data Claude Code already receives — no API calls, no tokens, no rate limits — and updates live as you work.

Contents

How it works

Two small pieces:

  1. Harvester — a Claude Code status line command. Claude hands it official session data (including rate_limits) on every render; it writes your usage to a cache file and prints nothing, so no line appears inside the pane.
  2. Segment — a tiny script your tmux status line calls. It reads that cache and renders the bar. Pure bash, no network.

Because the data comes from Claude itself, it's free and accurate, and refreshes whenever Claude renders — continuously while you work.

Requirements

  • tmux 3.0+
  • jq
  • Claude Code, signed in with a Claude Pro or Max subscription. The usage data (rate_limits) is sent only to Pro/Max sessions.

Installation

1. Add the plugin via TPM:

set -g @plugin 'docker-run/tmux-claude-usage'

2. Place the segment in your status line:

set -g status-right '#{claude_usage}  %Y-%m-%d %H:%M'

3. Fetch and wire it up — press prefix + I (TPM clones the plugin), then run the installer once (from inside tmux, so it can locate the clone):

bash "$(tmux show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -d= -f2-)tmux-claude-usage/scripts/init.sh"

init.sh adds the status line command to Claude Code's settings.json (under ~/.claude, or $CLAUDE_CONFIG_DIR if you've set one), backing it up first. Use Claude Code normally and the bar fills in.

Already have a Claude status line? init.sh keeps it: it chains your line and the harvester through the single slot, so both run and your line still shows. Use --force to install only the harvester instead, or --uninstall to restore your original line.

Ordering matters. Claude Code has only one status-line slot. If you set up another status-line tool (e.g. ccstatusline) after this — or re-run its configurator later — it overwrites the slot and the usage bar silently stops updating. Just re-run init.sh to re-chain (it picks the other tool back up), or run init.sh --check to diagnose.

Without TPM

Clone it anywhere and source the entry point from your tmux.conf:

git clone https://github.com/docker-run/tmux-claude-usage \
  ~/.tmux/plugins/tmux-claude-usage
run-shell ~/.tmux/plugins/tmux-claude-usage/claude-usage.tmux

Then place #{claude_usage} in your status line (step 2) and run that clone's scripts/init.sh (step 3).

Uninstall

bash "$(tmux show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -d= -f2-)tmux-claude-usage/scripts/init.sh" --uninstall

Restores any status line it chained, removes the harvester from Claude's settings.json, and deletes the usage cache. To remove the plugin entirely, also drop the @plugin line and #{claude_usage} from your tmux config and run TPM clean (prefix + alt + u).

Configuration

Out of the box the segment shows the 5-hour session window, inherits your theme's color normally, and turns amber then red as you approach your limit. Everything below is tunable — for example, override the colors to match your theme (hex values or tmux color names both work).

OptionDefaultDescription
@claude_usage_showsessionsession, weekly, or all
@claude_usage_show_baronShow the progress bar
@claude_usage_bar_width10Bar width in cells
@claude_usage_bar_fullFilled bar character
@claude_usage_bar_emptyEmpty bar character
@claude_usage_show_resetonShow "resets in …"
@claude_usage_show_labeloffPrefix "Session"/"Week" (auto-on for all)
@claude_usage_session_labelSessionLabel for the 5-hour window
@claude_usage_weekly_labelWeekLabel for the 7-day window
@claude_usage_prefix(empty)Text/icon before the segment
@claude_usage_separator Between windows in all mode
@claude_usage_stale_after(off)Seconds; flag the bar stale once the cache is older than this
@claude_usage_stale_labelstaleWord used in the stale marker
@claude_usage_warning_threshold70% for the warning color
@claude_usage_critical_threshold90% for the critical color
@claude_usage_color_normal(theme)Color below the warning threshold
@claude_usage_color_warning#e0af68Color at/above warning
@claude_usage_color_critical#f7768eColor at/above critical

Match the demo

The powerline look in the demo above is a full Tokyo Night Storm status-bar theme, not part of the plugin — the plugin only contributes the #{claude_usage} segment. For that exact look, check out examples/tokyo-night-storm.conf.

Update frequency

The bar repaints every status-interval seconds (standard tmux setting, default 15). Lower it for a snappier bar — it just re-reads a local file, so it's free:

set -g status-interval 5

Repainting isn't the same as refreshing, though: the underlying numbers only update when Claude Code renders and hands the harvester fresh data. Usage you rack up elsewhere — the browser, another machine — won't appear until a local Claude Code session renders again, so a number can sit unchanged while the real figure climbs. There's no token-free way to fetch it on demand. To avoid mistaking a stale figure for a live one, set @claude_usage_stale_after and the bar appends e.g. (stale 2 hr) once the cache passes that age:

set -g @claude_usage_stale_after 1800  # mark stale after 30 min

Contribution

See the CONTRIBUTION.md file.

License

MIT

// compatibility

Platformsapi, web
Operating systems
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguageShell

// faq

What is tmux-claude-usage?

Claude usage in tmux status bar. It is open-source on GitHub.

Is tmux-claude-usage free to use?

tmux-claude-usage is open-source under the MIT license, so it is free to use.

What category does tmux-claude-usage belong to?

tmux-claude-usage is listed under devops in the Claudeers registry of Claude-compatible tools.

0 views
10 stars
unclaimed
updated about 4 hours ago

// embed badge

tmux-claude-usage on Claudeers
[![Claudeers](https://claudeers.com/api/badge/tmux-claude-usage.svg)](https://claudeers.com/tmux-claude-usage)

// retro hit counter

tmux-claude-usage hit counter
[![Hits](https://claudeers.com/api/counter/tmux-claude-usage.svg)](https://claudeers.com/tmux-claude-usage)

// reviews

// guestbook

0/500

// related in DevOps & CI/CD

🔓

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI…

// devopssansan0/Python60,216GPL-3.0[ claude ]
🔓

Use Claude Code as the foundation for coding infrastructure, allowing you to decide how to interact with the model while enjoying updates from Anthropic.

// devopsmusistudio/TypeScript35,590MIT[ claude ]
🔓

Professional Antigravity Account Manager & Switcher. One-click seamless account switching for Antigravity Tools. Built with Tauri v2 + React (Rust).专业的 Antig…

// devopslbjlaq/Rust30,028NOASSERTION[ claude ]
→ see how tmux-claude-usage connects across the ecosystem