# 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* โ”‚ ๐Ÿค– Opus 4.8 (1M) ยท xhigh โ”‚ ๐Ÿ“ 84% (843k) โ”‚ ๐Ÿ“Š 34% 2h54m โ”‚ ๐Ÿ’ฐ $0.40 $12.00/h โ”‚ ๐Ÿ’พ 81% ``` Narrow โ€” trailing segments trimmed: ``` ๐Ÿ“ ~/.dots โ”‚ ๐ŸŒฟ .dots main* โ”‚ ๐Ÿค– Opus 4.8 (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 | window = 1M for `[1m]` models, else 200k. 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 | | ๐Ÿ’พ | **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%` | | 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 | | โ™ป๏ธ | `cache_segment` | prompt-cache hit % (higher is better) | | โš™๏ธ | `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.