byj = BitYoungJae
A curated statusline for Claude Code (CC) - showing only the essentials. Displays context usage like a car's fuel gauge and API utilization at a glance.
Lightweight: Single bash script, jq its only dependency β and no network calls at all.
Shows the current Claude model you're using.
π€ Sonnet 4.5
Normally the current working directory name (not the full path, just the folder name).
Claude Code can now send messages between sessions, and it addresses a peer session by
name. Since a name it derives is just <folder>-XX, showing it next to the folder
would only repeat it β so the name takes the folder's place:
π my-project-a4
That is the exact string another session uses to message this one. After /rename, when
the name no longer tells you the folder, both are shown:
π my-project | π·οΈ fuel-gauge-fix
The name comes from Claude Code's own session registry (~/.claude/sessions/), read on
every render, so it follows a /rename with no restart. If there is no entry for the
session, the folder name is shown alone, exactly as before.
Git branch name with colored status indicators:
| Symbol | Meaning | Example |
|---|---|---|
| π΄ | Modified files (unstaged) | πΏ main π΄ |
| π’ | Staged files | πΏ main π’ |
| π‘ | Untracked files | πΏ main π‘ |
| β | Clean - no changes | πΏ main β
|
Symbols can combine: πΏ main π΄π’ = modified + staged files
Note: In the actual terminal, these are displayed as ANSI-colored dots (
β) and checkmark (β).
Shows remaining safe context before autocompact triggers.
Format: β½ XX% (XXK) where:
- XX% = Percentage of safe space remaining
- (XXK) = Actual token count remaining
Color coding:
- π’ Green (β₯70%): Safe - plenty of space
- π‘ Yellow (30-70%): Caution - moderate usage
- π΄ Red (<30%): Warning - autocompact imminent (icon changes to
β οΈ )
Example: β½ 36% (57K) means:
- 36% of safe space left
- 57,000 tokens remaining before autocompact
Shows Anthropic API utilization from the Usage API.
Format: π 5h XX% Β· 7d XX% where:
- 5h XX% = 5-hour session utilization
- 7d XX% = 7-day weekly utilization
Color coding:
- π’ Green (<50%): Low usage
- π‘ Yellow (50-80%): Moderate usage
- π΄ Red (β₯80%): High usage
- Dimmed
~XX%(e.g.~20%): stale value β that window already reset; shown until the next refresh lands
Where the numbers come from: Claude Code hands these to the statusline directly, refreshed from the rate-limit headers of every API response. Nothing is fetched, so there is no token, no request, and nothing that can be rate-limited or time out.
git clone https://github.com/BitYoungjae/byj-cc-statusline.git
cd byj-cc-statusline
bash install-statusline.shThe installer will:
- β Check dependencies (jq)
- β
Backup existing configuration to
~/.local/share/byj-cc-statusline/backups/ - β
Copy
bin/statusline.shto~/.claude/ - β
Update
~/.claude/settings.json
curl -fsSL https://raw.githubusercontent.com/bityoungjae/byj-cc-statusline/main/install-statusline.sh -o /tmp/install.sh && \
curl -fsSL https://raw.githubusercontent.com/bityoungjae/byj-cc-statusline/main/bin/statusline.sh -o /tmp/statusline.sh && \
STATUSLINE_SOURCE=/tmp/statusline.sh bash /tmp/install.sh# 1. Copy statusline script
cp bin/statusline.sh ~/.claude/
chmod +x ~/.claude/statusline.sh
# 2. Update settings.json
# Add to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh",
"padding": 0
}
}
# 3. Restart Claude Code- Claude Code v2.0+ β the 5h/7d gauge additionally needs a build that sends
rate_limitson stdin (verified on 2.1.267) - jq - JSON parser
Install dependencies:
# macOS
brew install jq
# Linux
sudo apt install jq # Ubuntu/Debian
sudo yum install jq # CentOS/RHELThe fuel gauge reads context_window data provided by Claude Code via stdin, including context_window_size and current token usage.
Claude Code reserves buffer space for context management:
| Auto-compact Setting | Buffer Size | Safe Limit (200K) | Safe Limit (1M) |
|---|---|---|---|
| ON (default) | 33K (fixed) | 167K | 967K |
| OFF | 3K (fixed) | 197K | 997K |
Autocompact setting is read from ~/.claude.json.
Calculation example (auto-compact ON, 200K context):
Total context: 200,000 tokens
Autocompact buffer: 33,000 tokens (fixed)
βββββββββββββββββββββββββββββββββββββββββ
Safe limit: 167,000 tokens
Current usage: 97,830 tokens
Remaining fuel: 69,170 tokens β β½ 41%
The percentage shows how much safe space you have left before hitting the buffer threshold.
Claude Code tracks your 5h and 7d rate limits from the headers on every API response and passes them to the statusline on stdin. The statusline just reads them:
"rate_limits": {
"five_hour": { "used_percentage": 7.0, "resets_at": 1789038600 },
"seven_day": { "used_percentage": 29.0, "resets_at": 1789444800 }
}That makes the gauge fresher than polling (it moves with every response rather than on a 180-second timer) and completely free β no OAuth token, no HTTP request, nothing that can be rate-limited, time out, or need a lock.
Two details are worth knowing:
- A brand-new session has no numbers yet. The data is built up from responses, so before you send your first message there is nothing to show.
- A window disappears the moment it resets, until the next response brings the fresh one.
A small cache at ~/.cache/byj-cc-statusline/rate-limits.json covers both gaps. Every
render saves what it displayed, merged per window, so a new session opens with the last
known values and a just-reset window keeps showing its previous reading. Anything served
from the cache past its reset time is dimmed with a ~ (e.g. ~20%) so it is never
mistaken for a live number.
Earlier versions polled
GET /api/oauth/usagewith an OAuth token, a 180s cache, a single-flight lock and capped exponential backoff. Reading stdin replaced all of it.
byj-cc-statusline/
βββ README.md # This file
βββ LICENSE # MIT License
βββ CLAUDE.md # Claude Code instructions
βββ .gitignore # Git ignore rules
βββ install-statusline.sh # Automated installer
βββ bin/
βββ statusline.sh # Core statusline script
Statusline not working?
- Ensure jq is installed:
which jq - Restart Claude Code
Fuel gauge shows nothing?
- Start a conversation first (requires usage data)
Session name not showing?
- Only the folder name appears when Claude Code has not registered the session for
cross-session messaging β older versions have no
~/.claude/sessions/registry. This is a silent fallback, not a failure; nothing else on the line is affected.
API usage not showing?
- Send a message first β a session has no rate-limit data until its first API response
- Run the built-in diagnostic:
bash ~/.claude/statusline.sh --doctorβ shows the fallback cache, window expiry, and any leftover files from the old polling path - If it never appears, your Claude Code may be too old to send
rate_limitson stdin - Cache is at
~/.cache/byj-cc-statusline/rate-limits.json
Showing a dimmed ~20%?
- That is a cached value whose window has already reset β it refreshes on the next response
cd byj-cc-statusline
git pull
bash install-statusline.shYour existing settings will be automatically backed up to:
~/.local/share/byj-cc-statusline/backups/
MIT License - see LICENSE file for details.
