You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The script is a single pipeline: **JSON stdin → parse → compute → render ANSI line → stdout**.
36
36
37
-
Key sections in `claude-code-status-line.py` (~2,200 lines):
37
+
Key sections in `claude-code-status-line.py` (~2,350 lines):
38
38
39
39
-**Lines 34-115**: Configuration — `SL_THEME`/`SL_USAGE_CACHE_DURATION`/`SL_UPDATE_CACHE_DURATION`/`SL_UPDATE_RETRY_DURATION`/`SL_UPDATE_CUSTOM_RETRY_DURATION`/`SL_UPDATE_VERSION_CMD`/`SL_UPDATE_VERSION_SOURCE`/`SL_THEME_FILE` globals, then `SL_SEGMENTS` parsing (`_parse_segments`, `_has_segment`, `_segment_opts`). Width values capped at 128.
40
40
-**Lines ~116-165**: Color conversion (`hex_to_rgb`, `hex_to_256`) with hex length validation, and truecolor/256-color terminal detection via `COLORTERM` env var
41
41
-**Lines ~170-355**: Theme system — `THEMES` dict (dark/light, Nord-inspired), `_load_custom_theme()` loads optional `~/.claude/claude-code-theme.toml` via `tomllib`
42
-
-**Lines ~468**: `get_git_branch()` — subprocess call to `git branch --show-current`, strips ESC characters from output
43
-
-**Lines ~497**: `get_git_status()` — collects working directory state (staged/modified/deleted/renamed/untracked/conflicted), stash count, and ahead/behind status via `git status --porcelain=v1`, `git stash list`, and `git rev-list`
44
-
-**Lines ~571**: `_normalize_usage_data()` — converts CC 2.1.80+ `rate_limits` stdin JSON (unix timestamps, float percentages) to internal format (ISO 8601, utilization). `fetch_usage_data()` (deprecated) — OAuth API fallback for older CC versions, cached atomically to `~/.claude/.usage_cache.json`
45
-
-**Lines ~639-746**: Update checker — `get_installed_version()` runs `claude --version`, `fetch_latest_version()` queries npm registry with caching to `~/.claude/.update_cache.json`, `check_for_update()` compares versions via `parse_semver()`
46
-
-**Lines ~749-870**: Usage gauge rendering — vertical (block chars ▁▂▃▄▅▆▇█) and horizontal blocks styles with forward-looking ratio logic
47
-
-**Lines ~872**: `format_usage_indicators()` — returns dict with per-window usage strings
-**Lines ~2086**: `main()` — entry point, handles demo modes and normal stdin flow
42
+
-**Lines ~514**: `get_git_branch()` — subprocess call to `git branch --show-current`, strips ESC characters from output
43
+
-**Lines ~534**: `get_git_status()` — collects working directory state (staged/modified/deleted/renamed/untracked/conflicted), stash count, and ahead/behind status via `git status --porcelain=v1`, `git stash list`, and `git rev-list`
44
+
-**Lines ~620**: `_normalize_usage_data()` — converts CC 2.1.80+ `rate_limits` stdin JSON (unix timestamps, float percentages) to internal format (ISO 8601, utilization). `fetch_usage_data()` (deprecated) — OAuth API fallback for older CC versions, cached atomically to `~/.claude/.usage_cache.json`
45
+
-**Lines ~760-1000**: Update checker — `get_installed_version()` runs `claude --version`, `fetch_latest_version()` queries npm registry with caching to `~/.claude/.update_cache.json`, `check_for_update()` compares versions via `parse_semver()`
46
+
-**Lines ~1080-1160**: Usage gauge rendering — vertical (block chars ▁▂▃▄▅▆▇█) and horizontal blocks styles with forward-looking ratio logic
0 commit comments