Skip to content

Releases: benabraham/claude-code-status-line

v5.6.1

Choose a tag to compare

@benabraham benabraham released this 20 Sep 20:16

What's Changed

Fixed

  • Status line no longer blank at session start. Claude Code sends
    context_window.used_percentage as null until the session has an
    assistant message, and the script treated that as "no data at all" —
    printing nothing until the first request/response.

    • The context segments (progress_bar, percentage, tokens) are now
      skipped while the percentage is unknown; the model badge, directory,
      worktree, git and usage gauges render from the first frame.
    • No fabricated 0 % is shown — the system prompt and tool definitions
      already occupy context and cannot be measured before the API answers,
      which is why Claude Code reports null rather than zero.
    • The 5-hour and weekly gauges may still be empty for the first render
      or two while Claude Code's background quota probe resolves, then fill in.
  • Stray leading blank line when a new_line segment came before anything
    that rendered. Deliberate blank separators (two consecutive new_line
    segments) are unaffected.

No configuration changes — existing SL_SEGMENTS values and custom theme
files work unchanged.

Full Changelog: v5.6.0...v5.6.1

v5.6.0

Choose a tag to compare

@benabraham benabraham released this 13 Aug 00:20

What's Changed

New Features

Personal deadline (SL_USAGE_DEADLINE) — pace usage against your own horizon instead of the API reset, for when your week ends before the window does (you stop Friday noon, but the weekly limit resets Saturday 22:00).

export SL_USAGE_DEADLINE='2026-08-14T12:00'   # or '2026-08-14 12:00'

Absolute ISO 8601, local time unless you add an offset. It applies to every usage window whose reset falls after it, and moves all three things the window end feeds:

Without With deadline Fri 12:00
Reset label → Sat 22:00 → [Fri 12:00]
Gauge ratio & color vs. Sat 22:00 vs. Fri 12:00
Burndown ... then 1 d to renew ... then 2 h to stop
  • Only the window end moves — usage still accumulated from the real window start, so the observed burn rate stays honest. What shrinks is the time left to spend the rest.
  • The overridden end shows in square brackets so it never reads as an API reset.
  • Burndown says to stop rather than to renew, since budget does not renew at your deadline; the Soon message drops the renewal reference entirely.
  • Ignored once in the past, beyond the API reset, or unparseable — the API value is the automatic fallback, so a stale deadline needs no cleanup.

Fixes

  • Fixed a stale stdin JSON example in the README that made the script print nothing when copy-pasted.

No breaking changes — with SL_USAGE_DEADLINE unset, behaviour is identical to v5.5.0.

Full Changelog: v5.5.0...v5.6.0

v5.5.0

Choose a tag to compare

@benabraham benabraham released this 25 Jul 07:58

Added

usage_fable segment — a per-model weekly usage gauge, showing the separate weekly limit that /usage lists as its own row. Uses the same gauge styles, colors, and forward-looking ratio as usage_5hour / usage_weekly, and takes the same gauge and width options.

  ██   94 % → 10:28     ██   83 % → Sat 18:14   Fable ██   77 % → Sat 21:59
  └─ 5h ────────────┘   └─ weekly ──────────┘   └─ per-model ─────────────┘

Despite the name the segment is generic:

Option Values Default Description
model model display name Fable Which per-model limit to show (case-insensitive)
only_current 0/1 0 Show only while that model is active; also skips the usage request in other sessions
label full/short/none full Label left of the gauge — Fable, F, or none. Text follows model=
gauge vertical/blocks/none blocks Gauge style
width even integer >= 2 4 Gauge width

Changed

usage_fable is included in the default segment list. It is self-gating, so it stays invisible on accounts without a per-model weekly limit.

Limitations — please read

This segment cannot use the modern data path, and that has consequences worth knowing:

  • Claude Code's stdin rate_limits carries only five_hour and seven_day — no per-model data at all, verified live through CC 2.1.220. The only available source is the deprecated OAuth API.
  • It therefore costs a usage request. Disk-cached for SL_USAGE_CACHE_DURATION (default 300 s), so roughly one request per 5 minutes, not one per render. Remove usage_fable from SL_SEGMENTS, or set only_current=1, and no extra request is made.
  • It will stop rendering when that API is removed. It fails silently rather than erroring.
  • Whether you have a per-model cap at all depends on your account — plan tier, model access, and API/extra-usage settings all play into it, and those rules are Anthropic's to change. The segment models none of them: it renders whatever scoped limit the API returns and stays empty otherwise.
  • Needs credentials (macOS Keychain or ~/.claude/.credentials.json); without them it renders nothing.
  • No burndown — usage_burndown is driven by the shared seven_day window only.

Full details in the README.

v5.4.0

Choose a tag to compare

@benabraham benabraham released this 11 Jun 18:27

What's Changed

New Features

  • Fable model badge color: the model segment now renders a distinct badge for Fable models using Nord red — #BF616A (nord11) on dark themes, a muted #A8505A on light themes. Previously Fable fell back to the neutral default badge.
    • Customizable via the new model_fable theme key in your ~/.claude/claude-code-theme.toml.

Full Changelog: v5.3.0...v5.4.0

v5.3.0

Choose a tag to compare

@benabraham benabraham released this 09 May 06:02

What's Changed

Improvements

  • Live effort detection via stdin effort.level (CC 2.1.119+) — the canonical source. The model badge now reflects mid-session /effort changes and correctly displays all levels including max.
  • Effort badge is now omitted entirely on models that don't support effort, instead of showing a fallback character.

Display Changes

  • model:effort=short now renders L/M/H/X/MAX (was L/M/H/A with first-letter fallback for unknown values).
    • xhigh → X (explicit, was H via fallback)
    • max → MAX (was lowercase max)
    • auto no longer appears — CC always resolves it to a concrete level
  • model:effort=full now renders the actual level name including xhigh / max (was low/medium/high/auto).

Removed

  • CLAUDE_CODE_EFFORT_LEVEL env var override and settings-file fallback. These were workarounds for a missing upstream feature. No user action required — stdin now provides the live level automatically.

Full Changelog: v5.2.1...v5.3.0

v5.2.1

Choose a tag to compare

@benabraham benabraham released this 05 May 16:16

What's Changed

Fixes

  • Python 3.10 compatibility: replaced datetime.UTC (3.11+) with datetime.timezone.utc (available since 3.2). The script now runs on Python 3.10 — e.g. the default interpreter on Ubuntu 22.04 LTS. README updated to note the tomli package fallback for custom themes on 3.10.

Thanks to @vzoha for the contribution (#3)!

Full Changelog: v5.2.0...v5.2.1

v5.2.0

Choose a tag to compare

@benabraham benabraham released this 31 Mar 11:54

What's Changed

New Features

  • Plugin system for custom segments: Extend the statusline with custom segments by dropping .py files into plugin directories (.claude/statusline/ project-level, ~/.claude/statusline/ global). Each plugin defines register(api) to register segments via api.add_segment(). The API provides fg(), bg(), text_color(), RESET, and BOLD for themed ANSI output. Plugin errors are silently ignored. See README for a full example.

Improvements

  • Raw JSON input from Claude Code now available to segment renderers via ctx["data"] (enables access to session_id, cwd, and other fields)
  • Code style cleanup and formatting improvements

Full Changelog: v5.1.0...v5.2.0

v5.1.0

Choose a tag to compare

@benabraham benabraham released this 21 Mar 13:44

What's Changed

New Features

  • Effort level display in model badge via model:effort=short (L/M/H/A) or model:effort=full (low/medium/high/auto). Reads from settings files with precedence chain. Note: max is session-only and cannot be detected.
  • Dump mode (SL_DUMP=1) for development: logs every stdin JSON input with timestamp to /tmp/claude-statusline-dump.jsonl
  • Native rate_limits support: reads usage data directly from CC 2.1.80+ stdin JSON, eliminating OAuth API calls. Falls back to deprecated OAuth API for older CC versions.

Full Changelog: v5.0.0...v5.1.0

v5.0.0

Choose a tag to compare

@benabraham benabraham released this 06 Mar 10:13

What's Changed

⚠ Breaking Changes

model:effort option removed

  • Claude Code now displays reasoning effort level natively
  • If your SL_SEGMENTS includes model:effort=short or model:effort=full, remove the :effort=... part

Removed

  • get_effort_level() function and CLAUDE_CODE_EFFORT_LEVEL env var reading — no longer needed

Full Changelog: v4.13.1...v5.0.0

v4.13.1

Choose a tag to compare

@benabraham benabraham released this 06 Mar 09:45

What's Changed

Fixed

  • Burndown noise suppression after weekly window reset — the relevance filter now scales inversely with the Bayesian trust factor, preventing misleading "may run out X sooner" warnings from stale or spiked utilization data in the first hours of a new window

Full Changelog: v4.13.0...v4.13.1