A rich, three-line status bar for Claude Code CLI β works on macOS, Linux, WSL2, and Windows.
Displays real-time session metrics directly in your terminal β model, context usage, tokens, cost, duration, git branch, cache stats, subscription usage limits, and more.
Claude Opus 4.6 | [ββββββββββββββββββββ] 42% of 200.0K #1 | β156.8K β23.4K | cache r:89.0K w:45.0K
$1.47 | β± 5m42s (api 3m18s) | +245/-31 | β main | π my-project | [N]
5h [ββββββββββ] 68% β»2h41m | 7d [ββββββββββ] 48% β»1d20h
Claude Code's built-in status line shows the model name and a terse percentage. That's fine until you:
- Burn through your 5-hour / 7-day subscription quota without noticing and get cut off mid-task.
- Hit context auto-compaction and lose state because you didn't see 85% approaching.
- Rack up API cost on long sessions with no live $ counter.
- Lose track of cache hits vs writes when debugging performance.
- Switch between projects and forget which branch you're on.
claude-statusline solves all of it in a single shell script β zero runtime dependencies beyond jq and curl, ~20 ms per update, no daemon, no background process.
Model | [ββββββββββββ] PCT% of SIZE #W | βinput βoutput | cache r:READ w:WRITE
- Model name β which Claude model is active (color: cyan bold)
- Context usage bar β 20-char visual progress bar with color thresholds (green < 70% β yellow < 90% β red)
- Compaction counter
#Nβ increments every time the context window gets compacted during a session - Token counts β input (
β) and output (β) withK/Mformatting - Cache stats β cache read / write token counts
$COST | β± DURATION (api API_DUR) | +ADDED/-REMOVED | β BRANCH | π DIR | [N]
- Cost in USD (yellow)
- Duration total and API-only separately
- Lines added/removed during the session
- Git branch (when in a repo)
- Working directory name
- Vim mode
[N]/[I]indicator (when vim mode is active) - Sub-agent name (when an agent is running)
β >200Kwarning when tokens exceed 200K
5h [ββββββββββ] 68% β»2h41m | 7d [ββββββββββ] 48% β»1d20h
Real subscription limits pulled from https://api.anthropic.com/api/oauth/usage (cached 2 min). Shows remaining quota with a fuel-gauge colour (green > 50% β yellow > 20% β red) and countdown to reset. Only appears when you're logged in via claude.ai OAuth (not API key).
| Feature | macOS | Linux | WSL2 | Windows (Git Bash) |
|---|---|---|---|---|
| 3-line status bar | β | β | β | β |
| Usage limits (OAuth) | β Keychain | β libsecret β file | β file | β Cred Manager β file |
| Desktop notifications | β
osascript |
β
notify-send* |
β
notify-send* |
β
BurntToast* |
| Installer | install.sh |
install.sh |
install.sh |
install.ps1 |
* β optional. If the notifier isn't installed the feature silently no-ops (status line still works).
WSL2 is treated as Linux (detected via /proc/version). If you want native Windows toast notifications from inside WSL2 you'll need WSLg + a Linux notifier, or invoke BurntToast via powershell.exe.
- jq β JSON processor
- curl β for usage limits API (skips gracefully if missing)
- bash β 3.2+ (macOS default) or any modern 4/5
- Claude Code CLI β v1.0+ with status line support
- Optional:
notify-send(Linux),libsecret-tools(Linux),BurntToast(Windows)
Install jq on your platform:
| OS | Command |
|---|---|
| macOS | brew install jq |
| Debian/Ubuntu | sudo apt-get install jq |
| Fedora/RHEL | sudo dnf install jq |
| Arch | sudo pacman -S jq |
| Alpine | sudo apk add jq |
| Windows | winget install jqlang.jq or choco install jq |
git clone https://github.com/vbcherepanov/claude-statusbar.git
cd claude-statusbar
bash install.shgit clone https://github.com/vbcherepanov/claude-statusbar.git
cd claude-statusbar
powershell -ExecutionPolicy Bypass -File install.ps1(You can also run bash install.sh inside Git Bash on Windows β it'll work the same way.)
The installer will:
- Detect your OS and check dependencies with platform-specific install hints
- Copy
statusline.shto~/.claude/statusline.sh - Add the
statusLineconfig to~/.claude/settings.json - Prompt before overwriting existing files
cp statusline.sh ~/.claude/statusline.sh
chmod +x ~/.claude/statusline.shAdd to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "/ABSOLUTE/PATH/TO/.claude/statusline.sh",
"padding": 2
}
}On Windows the command is bash 'C:/Users/YOU/.claude/statusline.sh'.
Restart Claude Code.
Claude Code pipes session JSON to stdin every ~300 ms. The script:
- Parses all 16 fields in a single
jqcall with@shfor safe eval - Formats values in pure bash (no
bc, noawk, no extra subshells) - Fetches usage limits with a 2-minute cache (background on macOS/Windows, sync on Linux/WSL2 β because Claude Code kills backgrounded child processes on exit)
- Writes threshold flags at 70% / 85% / 95% context for hook integration
- Outputs three ANSI-coloured lines
Execution time: ~20 ms on macOS (cache warm), ~100 ms on Linux cold start.
The code is a single self-contained shell script (~320 lines). No daemon. No database. No network except the cached usage-limits endpoint.
All toggles are environment variables β set them in your shell profile or a wrapper script.
| Variable | Default | Purpose |
|---|---|---|
STATUSLINE_USAGE_LIMITS |
1 |
Set 0 to disable 5h/7d line (no network calls) |
STATUSLINE_WINDOW_COUNTER |
1 |
Set 0 to disable #N compaction counter |
STATUSLINE_FLAGS |
1 |
Set 0 to disable threshold flag files |
STATUSLINE_FLAG_DIR |
~/.claude/.context-flags |
Custom directory for flag files |
statusline.sh --version # prints: claude-statusline 1.1.0
statusline.sh --help # flags, env vars, and link to repo
When context usage crosses 70 / 85 / 95 %, the script writes a JSON file to $STATUSLINE_FLAG_DIR. Claude Code hooks can watch this directory to trigger auto-save, notifications, or whatever else.
{"pct":87,"in":"156.8K","out":"23.4K","cost":"$1.47","dur":"5m42s","cwd":"/path","t":"2026-04-19T16:06:42Z"}At 85% and 95% you also get a native desktop notification (macOS / Linux / WSL2 / Windows β see Platform support).
Fetches subscription quota using your Claude OAuth token. The script tries, in order:
- macOS β Keychain via
security find-generic-password - Windows β Credential Manager via
powershell.exe+CredentialManagermodule - Linux/WSL2 β libsecret via
secret-tool - Everywhere β fallback to
~/.claude/.credentials.json(0600perms)
The file fallback is what makes Linux work out-of-the-box (Claude Code doesn't write to the Linux keyring). It's also why you can have a broken keyring on macOS/Windows and the script still works.
Requires claude.ai OAuth login. API-key users will simply not see line 3.
cat examples/sample-input.json | bash statusline.shYou can pipe this to the script on any platform to see a rendered status line without launching Claude Code.
bash uninstall.shOr manually:
rm ~/.claude/statusline.sh
rm -rf ~/.claude/.context-flags ~/.claude/.usage-cache.json
# Remove the "statusLine" key from ~/.claude/settings.jsonIf this saves you time (or subscription cost), consider buying me a coffee:
There's also a Sponsor button at the top of the GitHub repo (.github/FUNDING.yml β PayPal).
Bug reports and PRs welcome, especially platform-specific fixes. The entire thing is one shell script β you can read it in 10 minutes.
Before a PR:
bash -n statusline.sh install.sh uninstall.sh # syntax
shellcheck statusline.sh install.sh uninstall.sh # lint (optional)
cat examples/sample-input.json | bash statusline.sh # smoke test