Claude Code Statusline
A feature-rich, single-file Node.js statusline for Claude Code.
One line at the bottom of your terminal that tells you everything you actually need:
which model you're on, the live git state of your repo, how much context you've
burned, your prompt-cache hit/write state, and your subscription rate limits.
No dependencies. No build step. Works on macOS, Linux, and Windows.
Preview
Op4.7:hg (1m) │ tweaks ▸ claude-…tusline (main) │ 3M 1? ↑2 push │ ██░░░ 480k/1M │ cache 87% ↓75k +360 1h:42m │ 5h:35%(2h15m) │ 7d:42%(4d)
Each segment is color-coded (dim, bright, cyan, pink, green, yellow, orange, red) so the
shape of the line itself communicates urgency at a glance. Labels are aggressively
shortened so the line fits your terminal: the width budget is read from the COLUMNS
environment variable that Claude Code exports to the script (v2.1.153+), with a fixed
100-column fallback for older builds and manual runs.
What you see, left to right
| Segment | Meaning |
|---|
Op4.7 (1m) | Current model, abbreviated: family (Op/So/Ha/My/Fb) glued to the version + context size (dim). Opus 4.7 (1M context) becomes Op4.7 (1m), Fable 5 becomes Fb5. Unrecognised model names are shown as-is. |
Op4.7:hg | Reasoning-effort tier as a lowercase code colon-glued to the model (same dim shade): lo/md/hg/xhg/max for low/medium/high/xhigh/max. The one exception is max, rendered in red: max is the most expensive tier, rarely a default, and easy to leave switched on after a one-off /effort max. Reflects the live value (including mid-session /effort changes); the context size trails it — Op4.7:hg (1m). Shown only on models that report effort.level; absent on models that don't support reasoning effort |
stl:expl | Active output style, shown only when it isn't default: expl/learn/conc/proact for the built-in Explanatory/Learning/Concise/Proactive, custom styles lowercased and cut to 7 chars. A non-default style changes how Claude responds and is saved per project by /config, so it quietly differs between projects and is easy to forget. Dim label; the code takes the same pink as a low context bar |
claude-…tusline (main) | Working directory basename (dim) + current branch in cyan; shows (HEAD@<sha>) in red for detached HEAD. The basename is trimmed to a 15-char head…tail middle ellipsis (7 chars each side) only when the full status line would otherwise exceed the width budget (the terminal width from COLUMNS, 100 columns when it's absent) — short lines keep the full name |
tweaks ▸ statusline (main) | When the working directory has moved away from where the session was launched (workspace.project_dir ≠ workspace.current_dir, e.g. after a cd), the launch dir basename is prepended as a dim ▸ breadcrumb so it's clear the session — and its transcript — is rooted elsewhere than the current directory. Hidden when the two match. Short lines keep both names in full; once the line would cross the width budget, width is reclaimed in stages — the current-dir name is ellipsised, then the launch name, then the breadcrumb is dropped entirely |
3M 1A 1D 1R 2? 1! | Working tree status, bucketed by VS Code-style codes: M = modified, A = added/staged, D = deleted, R = renamed, ? = untracked. All shown dim. ! = unmerged conflict, rendered separately in red because it's the only one that blocks a commit. Empty buckets are hidden — clean repo shows nothing |
↑2 push / ↓1 pull | Local branch is ahead/behind origin/<branch> |
██░░░ 480k/1M | Context window usage — 5-cell bar with half-block precision (█▌░, ~10% per step in 5 cells). When Claude Code provides absolute context counters, the bar is driven by total_input_tokens / context_window_size and the segment appends the raw counts (for example 480k/1M). When only remaining_percentage is available, the bar falls back to 100 - remaining |