statusline #
Claude Code status line package showing model name, effort level, context window token usage, API rate limit warnings, and a context-aware activity word.
What it displays #
Model info appears first, followed by a fixed-width token counter, rate limit indicators when approaching limits, and an activity word extracted from conversation context.
Normal usage (rate limits comfortable):
Opus 51,045/1,000,000 Searching
Approaching a limit (session window at 72% used, 28% remaining):
Opus 51,045/1,000,000 28% left (1h23m) Refactoring
Both tiers constrained:
Opus 51,045/1,000,000 28% left (1h23m) · 12% left (3d2h) Compiling
Projected to exceed (60% used in the first 2h of a 5h window; remaining looks fine but burn rate extrapolates to 150%):
Opus 51,045/1,000,000 40% left →150% (3h) Refactoring
The →150% marker shows the extrapolated end-of-window usage.
The segment renders in red whenever projection exceeds 100%,
even if remaining capacity is above the normal 50% threshold.
The token counter is always 7 characters wide (TTT,OOO format) so the display never shifts.
Activity word #
Replaces Claude Code's built-in spinner verbs, which pick random words from a flat list with no relation to what Claude is actually doing (anthropics/claude-code#33057).
The statusline extracts a gerund from the last 8KB of the session transcript instead. Since Claude's prose naturally contains gerunds that describe its current activity ("Let me search for...", "I'll try refactoring..."), the displayed word reflects what Claude was most recently talking about.
How it works #
- The statusline JSON payload includes
transcript_path openAsBlobreads only the final 8KB of the transcript (no full-file load)- A regex finds all words matching
\b[a-z]+-?[a-z]*ing\b(including hyphenated compounds) - A noise filter removes non-activity words (pronouns, prepositions, adjectives, phase-implying verbs)
- The last surviving match is capitalized and displayed
- Falls back to "Thinking" when no gerund is found or the transcript is unavailable
Noise filter categories #
- Phase-implying: "beginning", "completing", "finishing", "stopping"; sound wrong at arbitrary points in processing
- Too generic: "asking", "doing", "getting", "making", "working"; uninformative as status words
- Pronouns/determiners: "something", "nothing", "anything", "everything"
- Prepositions/conjunctions: "according", "during", "including", "regarding"
- Adjectives: "interesting", "existing", "surprising", "confusing"
- Not gerunds: "string", "king", "ring", "spring"; root contains "-ing"
- Common filler verbs: "being", "needing", "using", "thinking"
Required settings #
Disable the built-in spinner verbs and tips so they don't compete with the statusline word:
{
"spinnerVerbs": { "mode": "replace", "verbs": [] },
"spinnerTipsEnabled": false
}
Limitations #
- The transcript is scanned as a raw string, not parsed as JSONL. Gerunds from any source (assistant text, tool output, user messages) can appear. In practice, assistant prose dominates the tail of the transcript.
- The word reflects the most recent gerund in the last 8KB, which may lag behind the current activity by one or more tool calls.
- At the start of a session (empty transcript), the fallback "Thinking" is shown.
Model name #
The model family name (Opus, Sonnet, Haiku) is shown after the activity word. Version and context size are stripped when they match the current defaults:
- Opus: latest 4.8, default 1M context
- Sonnet: latest 4.6, default 200K context
- Haiku: latest 4.5, default 200K context
Non-default values are kept:
Sonnet with 1M context shows Sonnet (1M),
an older model shows Opus 4.5.
Effort level #
When the effort level is below "high" (the default), a yellow symbol appears after the model name:
- low:
Opus ○ - medium:
Opus ◐ - high: no indicator (default, nothing extra shown)
- max:
Opus ◉
The symbols match Claude Code's built-in effort indicators.
The effort level is read from ~/.claude/settings.json (effortLevel field)
because the statusline JSON payload does not include it yet
(anthropics/claude-code#40261).
Changes made via /effort or /fast that write to settings are picked up on the next statusline refresh.
In-session toggles that skip the settings file will not be reflected.
Rate limit indicators #
Rate limit warnings use a "remaining + time-to-reset" framing. Instead of "72% used, resets at 4pm, " the status line shows "28% left (1h23m). " This answers the natural question: "How much can I do before it refills? "
Indicators appear when either condition holds:
- Remaining capacity drops to 50% or below, or
- Current burn rate, extrapolated to the window reset, exceeds 100%.
When everything is comfortable and burn rate is sustainable, nothing extra is shown; no news is good news.
Projection #
Each tier's window has a fixed duration (5 hours for five_hour,
7 days for seven_day).
Elapsed time is recovered from windowSize - (resets_at - now),
burn rate is used_percentage / elapsed,
and the projected end-of-window usage is burn_rate * windowSize.
When projection exceeds 100%,
the segment renders in red and appends a →Z% marker
showing the extrapolated total (e.g.,
40% left →150% (3h)).
Projection is suppressed until usage reaches 5%,
since extrapolating from a near-zero
sample at the start of a window produces unstable estimates.
Two tiers are tracked from the statusline JSON payload:
- Session (
rate_limits.five_hour): 5-hour rolling window - Week (
rate_limits.seven_day): 7-day rolling window
If both tiers are constrained, both appear separated by a centered dot. If only one is constrained, only that one is shown. Data is only available for Pro/Max subscribers after the first API response in a session.
Color thresholds #
Context window (token counter):
- Default (no color): under 100,000 tokens
- Yellow: 100,000 or more
- Pink/magenta: 200,000 or more
- White: 900,000 or more (near context limit)
Rate limit remaining:
- Green: more than 25% remaining
- Yellow: 10-25% remaining
- Red: 10% or less remaining, or projection exceeds 100% at any remaining level
Token calculation #
Sums all token types from the current API state:
input_tokens + cache_creation_input_tokens + cache_read_input_tokens + output_tokens
from context_window.current_usage.
This matches the built-in token counter (SBH in Claude Code's source),
which includes output tokens.
Note that used_percentage excludes output tokens,
so this count is slightly higher.
The count may briefly differ from the built-in counter during active tool use or subagent work.
The built-in reads usage from the last message in the conversation,
while context_window.current_usage comes from the statusline JSON payload.
These data sources can reference different API calls until the next assistant response settles them.
Claude Code debounces statusline script invocations at 300ms. This is built into Claude Code itself and cannot be configured from the script side.
Runtime #
The package builds a Node CLI at dist/final/node/statusline.mjs.
Runtime code uses Node standard-library APIs only and has no Bun dependency.
Installation #
Build the package with mise run //package/claude-code-plugin/statusline:build,
then add the built command to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "node /path/to/packages/claude-code-plugin/statusline/dist/final/node/statusline.mjs"
},
"spinnerVerbs": { "mode": "replace", "verbs": [""] },
"spinnerTipsEnabled": false
}
The package also exposes a private workspace bin named claude-code-statusline.
Why this is not a Claude Code plugin #
Claude Code plugins cannot contribute a statusLine.
The plugins-reference "File locations" table states that a plugin's bundled settings.json
supports only the agent and subagentStatusLine keys;
statusLine is user-scope only and must live in ~/.claude/settings.json.
subagentStatusLine is a separate feature (it formats rows in the subagent panel)
and is not a substitute for the main status line.
That is why this directory has no .claude-plugin/plugin.json
and is not listed in the repo's marketplace.json.