Bar
A battery-themed statusline that lives inside your Claude Code terminal. Context usage, session rate-limits, and git info - all rendered as a persistent 3-line display with intensity-aware colors.
Features
Everything you need to stay aware of your Claude Code resource consumption without leaving the terminal.
Statusline Anatomy
Three lines, each independently toggleable. Every element is carefully formatted to maximize information density while remaining scannable at a glance.
Progress bars and percentages shift color based on how much of your capacity is consumed. Four thresholds create a visual heat gradient.
contextModel & Token UsagesessionRate-Limit WindowgitRepository StateToggle lines via ~/.bar/config.json or the interactive setup wizard.
ModelActive Claude model (e.g., Opus 4.6)TokensUsed / total in compact format (87k/167k)Progress bar10-character visual fill indicatorPercentageContext utilization with intensity colorUtilizationPercentage of 5-hour window consumedProgress barSession fill with intensity coloringCountdownTime remaining until window resetsWorktreeProject name shown when in a worktreeBranchCurrent branch with branch symbolDiff statsLines added (+) and removed (-)Architecture
11 focused modules, zero npm dependencies. Everything is built on Node.js built-ins - no chalk, no axios, no inquirer. Even the interactive prompt and HTTP client are hand-rolled.
index.jsCLI entry point and mode dispatcherrender.jsCore 3-line statusline rendererusage.jsAnthropic API usage fetcher + cachetokens.jsOAuth token resolution and refreshlogin.jsOAuth 2.0 + PKCE authentication flowgit.jsGit info extraction with cachingcolors.jsANSI 24-bit true color constantsconfig.js~/.bar/config.json read/writesetup.jsInteractive setup wizardprompts.jsCustom multi-select terminal UIhttp.jsMinimal HTTP(S) client (zero deps)Two separate caches keep renders fast without hammering external services. Both use /tmp for automatic cleanup on reboot.
Bar checks four sources in priority order to find an OAuth token. Auto-refreshes on 401 responses.
BAR_TOKENEnvironment variable (highest priority)CLAUDE_CODE_OAUTH_TOKENClaude Code's own OAuth token~/.bar/tokens.jsonStored tokens from claude-bar login~/.battery/tokens/Cross-compatible with Battery appHow It Works
Claude Code invokes Bar via the statusLine setting. Bar reads piped JSON, fetches usage data, and prints formatted ANSI output.
Get Started
One command runs the interactive setup wizard. It handles line selection, global install, OAuth login, and Claude Code configuration.
Zero dependencies. No lock-in. Uninstall with npm uninstall -g @allthingsclaude/bar and remove the statusLine key from your settings.
The interactive wizard walks you through everything in under a minute.
1. Choose linesMulti-select which of the 3 lines to display2. Save configWrites preferences to ~/.bar/config.json3. Global installInstalls @allthingsclaude/bar globally via npm4. OAuth loginOpens browser for Anthropic authentication (if session line enabled)5. ConfigureWrites statusLine setting to ~/.claude/settings.json