Files
dots/common/.config/claude/StatusBar.md
T
Coja 93b4f695ce [Sync] LLM clients → Qwen3.6-35B-A3B-Thinking default, Ornith preset, fl GPU monitor abbrs
Re-export of private HEAD 73b4a65: default-model flip + 8k thinking budget
in the aichat/opencode/pi client configs, the Ornith-1.5-35B-A3B preset and
its gate bench in fl/.config/llamacpp, and the fl fish abbrs `vram` /
`vramx` with the new gpumon.sh (sysfs VRAM/GTT monitor).
2026-10-16 14:11:09 +02:00

5.5 KiB
Raw Blame History

Status line (statusline.py)

The custom Claude Code status line, ordered work info (left) → system info (right), segments joined by a light-gray │. It's responsive: always a single line — if the rendered width would exceed the terminal ($COLUMNS, which Claude Code re-exports on resize), trailing (lowest-priority) segments are dropped from the right until it fits.

Wide — everything:

📁 ~/.dots │ 🌿 .dots main* │ 🤖 Fable 5 (1M) · xhigh │ 📝 84% (843k) │ 📊 34% 2h54m │ 💰 $0.40 $12.00/h │ 🔢 ↑63M ↓595k │ ♻️ 91% 1h │ 💾 81%

Narrow — trailing segments trimmed:

📁 ~/.dots │ 🌿 .dots main* │ 🤖 Fable 5 (1M) · xhigh │ 📝 84% (843k) │ 📊 34% 2h54m │ 💰 $0.40 $12.00/h

Every segment is defensive: if its data is missing or a command fails, the segment is simply omitted (the bar never crashes the UI). Secondary detail (the parts in light gray) is supplementary to the main colored value.

Live segments

Segment Shows Notes
Vim mode [I]/[N]/[V] editor mode only with editorMode: vim; pair with hideVimModeIndicator: true so the built-in one doesn't duplicate it
📁 Directory Current working dir, with ~ for home cyan
🌿 Git repo branch + * if dirty + ↑N/↓N ahead/behind upstream repo = magenta; branch = green when clean, yellow + red * when dirty; ↑ cyan, ↓ yellow. Omitted outside a repo
🤖 Model Active model display name + · effort level (low/medium/high/xhigh) name = blue, effort = light gray; effort omitted for models without the param
📝 Context % of context window used + (Nk) tokens usage comes from the payload's context_window (used_percentage + current_usage, Claude Code 2.1.x); the transcript's last message.usage is only a fallback. Window from context_window.context_window_size, then (1M …) in the display name, else 200k — not from model.id, which arrives with any [1m] suffix already stripped. Adds a red ⚠compact at ≥80%
📊 5h usage % of the 5-hour rolling limit used + time until it resets from rate_limits.five_hour; Pro/Max only, and absent until the first API response of a session
💰 Cost $ session cost so far + $/h burn rate burn rate shown once the session exceeds ~30s
🔢 Session tokens ↑ input + ↓ output tokens used so far this session (cumulative, k/M) summed over the transcript's assistant message.usage blocks, de-duplicated by message id (one line per content block shares the same usage). Input = input + cache_creation + cache_read — everything billed as input, so on a 1M session it dwarfs output (every call re-reads the cached prefix). Main transcript only: subagent usage lives in separate sidechain files. Incremental: a per-session state file ~/.claude/cache/statusline.tokens.<session>.json remembers the byte offset already summed, so each refresh parses only the new tail (cold scan of a 6.5 MB transcript ≈ 70 ms, warm ≈ 0.1 ms); stale state files are pruned after 7 days once 50+ pile up. Omitted when there is no transcript; ↑ cyan, ↓ green, no thresholds
♻️ Prompt cache hit % (higher is better) + cache TTL (5m / 1h), yellow ·cold once it has expired from the payload's prompt_cache (2.1.260+: hit_ratio 0–1, ttl, warm); computed from usage on older payloads. A 1h TTL is what keeps a 10-min /pr-loop cadence warm
💾 Disk % used of the filesystem at the cwd from statvfs

Colour legend

Most numbers are green / yellow / red by threshold — green = healthy, red = needs attention. Light gray = secondary detail. Thresholds (green < … < yellow < … ≤ red):

Segment green yellow red
Context < 50% 50–80% ≥ 80% (⚠compact)
5h usage < 50% 50–80% ≥ 80%
Prompt cache (inverted) ≥ 80% 50–80% < 50%
Disk < 75% 75–90% ≥ 90%

Light gray is \033[37m; dimming (\033[2m) is disabled because it blended the gray detail text into dark terminal backgrounds. To go brighter, set "gray" to \033[97m (bright white) in the C table near the top of statusline.py.

Optional segments (defined but not shown)

These functions exist in statusline.py but aren't in the output. Enable one by adding it to the work or system list in main():

RAM/CPU/temp were retired 2026-07-26: the status line only refreshes on message events, so system metrics sat visibly stale between turns — the tmux status bar (tmux/scripts/) owns live system metrics now.

Function Shows
🧠 ram_segment % used + used/totalG from /proc/meminfo (green <70% / yellow / red ≥85%)
🖥️ cpu_segment % busy (diffed /proc/stat snapshot) + loadavg + cores (green <60% / red ≥85%)
🌡️ temp_segment hottest CPU thermal zone °C (green <60 / red ≥80)
✏️ velocity_segment +added/-removed lines this session + lines/min
⚙️ api_segment share of wall-clock time spent in API/inference
version_segment Claude Code version (vX.Y.Z)
🎨 style_segment active output-style name

Where it lives

statusline.py is tracked in this repo and symlinked to ~/.claude/statusline.py; settings.json runs it via statusLine (/usr/bin/env python3 ~/.claude/statusline.py). Edits take effect on the next status refresh.