Skip to content

Releases: shrwnsan/claude-statusline

v2.4.1: Fix blank statusline for Claude Code 2026 + monochrome context window icon

Choose a tag to compare

@shrwnsan shrwnsan released this 29 May 18:30
08cbfb7

Fixed

  • Blank statusline regression for Claude Code v2.1.145+: Claude Code 2026 payloads grew to ~1067 bytes with new fields (session_id, transcript_path, cost, effort, thinking, workspace.repo, output_style). This silently exceeded the old maxLength: 1000 guard in validateInput(), causing every render to fall back to a bare project *model output with no git branch, no context window %, and no Nerd Font icons. Default raised to maxLength: 8192.

Changed

  • Nerd Font contextWindow symbol replaced: (U+26A1, colorful Unicode emoji) → 󱐌 (nf-md-lightning_bolt_circle, U+F140C — monochrome Nerd Font PUA glyph, consistent with the rest of the icon set). Requires Nerd Fonts v2.3+, satisfied by any font installed from Homebrew's nerd-fonts cask.

Full Changelog: v2.4.0...v2.4.1

v2.4.0: Rendering Hygiene & Codebase Cleanup

Choose a tag to compare

@shrwnsan shrwnsan released this 29 May 17:46
90885c4

Breaking Change

Nerd Font glyphs are now opt-in. If you were relying on auto-detected Nerd Fonts, you will now see ASCII output. Fix: add "nerdFont": true to your config or set NERD_FONT=1.

Changed

  • Nerd Font support is now opt-in via nerdFont: true config or NERD_FONT=1 (default: ASCII). Eliminates tofu / random-char rendering on terminals without a Nerd Font installed.
  • Default contextWindow symbol no longer includes the U+FE0E text variation selector, fixing visible artifacts on Terminal.app and tmux.
  • Config discovery now walks all parent directories (stops at filesystem root).

Added

  • --self-test and --demo CLI flags for verifying rendering without launching Claude Code.
  • nerdFont config field and NERD_FONT / CLAUDE_CODE_STATUSLINE_NERD_FONT environment variables for explicit Nerd Font opt-in.

Fixed

  • Environment icons (node/python/docker) now respect ASCII mode instead of leaking Nerd Font PUA characters.
  • Non-zero exits replaced with a minimal-mode render to prevent blank statusline (per Claude Code statusline contract).

Removed

  • Unreliable Nerd Font auto-detection (system_profiler, brew list, terminal-program heuristics).
  • Vestigial softWrap config field and CLAUDE_CODE_STATUSLINE_SOFT_WRAP env var (never read). noSoftWrap is unaffected and still supported.
  • Dead code: EnvironmentDetector.formatEnvironmentInfo, EnvironmentFormatter.format/Verbose/Minimal, softWrapText, testSymbolDisplay, getAdditionalTools, indicator-order validation loop.

Full Changelog: v2.3.1...v2.4.0

v2.3.1

Choose a tag to compare

@shrwnsan shrwnsan released this 11 Feb 06:57

Fixes

  • Handle empty stdin gracefully - exit silently with code 0 instead of throwing error
  • Updated readInput() to return null when stdin is empty/whitespace only

Full Changelog: v2.3.0...v2.3.1

v2.3.0

Choose a tag to compare

@shrwnsan shrwnsan released this 11 Feb 06:54

VPN Status Indicator (macOS only)

  • Displays ◉ when VPN is connected, ○ when disconnected
  • Independent toggle via vpnIndicator config option or CLAUDE_CODE_STATUSLINE_VPN_INDICATOR env var
  • Uses scutil --nwi to detect utun interfaces
  • Cached with 30-second TTL since VPN status changes frequently
  • ASCII fallback: ·vpn · (on) / ·vpn · (off)

Fixes

  • Symlink resolution in bin wrapper now uses realpathSync for correct path handling
  • Only fetch environment versions when envContext is enabled to reduce overhead
  • VPN detection only runs when vpnIndicator is enabled
  • Fixed spacing when only VPN indicator is enabled

Full Changelog: v2.2.0...v2.3.0

v2.2.0 - Context Window Display Improvements

Choose a tag to compare

@shrwnsan shrwnsan released this 06 Feb 06:43
87811dd

Changes

  • Context window display now shows remaining percentage instead of used

    • Displays ≈76% (76% remaining) instead of 24% (24% used)
    • Simplified implementation using API's remaining_percentage field directly
    • Changed ASCII fallback symbol from # to for better semantic meaning
    • Aligns with bash statusline script approach
  • Removed legacy calculation code

    • No longer manually calculates from token counts
    • API provides pre-calculated percentages since Claude Code v2.1.15
    • Reduced bundle size from 53.78 KB to 52.54 KB

🤖 Generated by Claude Code - GLM 4.7

v2.1.7

Choose a tag to compare

@shrwnsan shrwnsan released this 06 Feb 02:26

Security & Bug Fixes

Security

  • Fixed command injection vulnerabilities by replacing exec() shell string interpolation with execFile() argv arrays
    • Affected files: src/core/cache.ts, src/env/context.ts, src/ui/width.ts
    • All external commands now use safe argument arrays instead of shell interpretation
  • Added mode: 0o700 to cache directory mkdir() for owner-only access

Fixed

  • Unicode truncation now properly handles multi-byte characters (emojis, CJK)
    • Rewrote truncateText() and smartTruncate() to use getStringDisplayWidth()
    • Uses Array.from() for proper grapheme cluster iteration
  • Replaced synchronous readFileSync() with async readFile() for stdin

Full details: See eval-002 comprehensive code review

🤖 Generated by Claude Code - GLM 4.7

v2.1.6

Choose a tag to compare

@shrwnsan shrwnsan released this 06 Feb 02:24

What's Changed

Fixed

  • Context window percentage now matches /context command output

🤖 Generated by Claude Code - GLM 4.7

v2.1.5 - Context Window Bug Workaround

Choose a tag to compare

@shrwnsan shrwnsan released this 23 Jan 02:03

What's Changed

Fixed

  • Added workaround for Claude Code v2.1.8+ bug where current_usage fields are all zeros and used_percentage is incorrectly set to 0
    • Now calculates from total_input_tokens as fallback
    • Maintains backward compatibility with v2.1.7 and earlier
    • Ready for future Claude Code versions where used_percentage may be fixed

Related Issues

Note: There may be occasional rendering artifacts (e.g., 0%34%) due to Claude Code's terminal handling. This is a Claude Code issue, not a statusline issue. The actual percentage calculation is correct.

🤖 Generated with Claude Code - GLM 4.7

v2.1.4: Fix context percentage display

Choose a tag to compare

@shrwnsan shrwnsan released this 22 Jan 11:25

Fixed

  • Context percentage now displays correctly with Claude Code v2.1.15+
  • Added support for new context_window.used_percentage field
  • Maintains backward compatibility with manual calculation fallback

Context

Claude Code v2.1.15 introduced pre-calculated used_percentage and remaining_percentage fields in the context_window object. The previous code only checked for the legacy current_usage field, causing context percentage to always show 0%.

Testing

  • With used_percentage: 42.5 → Shows 43% (rounded)
  • Without used_percentage (legacy) → Shows 8% (calculated from current_usage)

v2.1.2 - Model String Wrapping Fix

Choose a tag to compare

@shrwnsan shrwnsan released this 19 Dec 06:29

Fix: Model String Wrapping

This release fixes an issue where long model names would be split across lines, causing the model indicator to be separated from the model name.

Changes:

  • Modified soft wrapping logic to detect model strings
  • When model string exceeds available width, the entire section wraps to the next line
  • Model indicator and context usage now stay together as intended

Example:

Before: beacon-delivery-compass  main [!?] 󰚩gl\nm-4.6 ⚡︎40%
After: beacon-delivery-compass  main [!?]\n󰚩glm-4.6 ⚡︎40%

🤖 Generated by Claude Code - GLM 4.6