Releases: shrwnsan/claude-statusline
Release list
v2.4.1: Fix blank statusline for Claude Code 2026 + monochrome context window icon
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 oldmaxLength: 1000guard invalidateInput(), causing every render to fall back to a bareproject *modeloutput with no git branch, no context window %, and no Nerd Font icons. Default raised tomaxLength: 8192.
Changed
- Nerd Font
contextWindowsymbol 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'snerd-fontscask.
Full Changelog: v2.4.0...v2.4.1
v2.4.0: Rendering Hygiene & Codebase Cleanup
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: trueconfig orNERD_FONT=1(default: ASCII). Eliminates tofu / random-char rendering on terminals without a Nerd Font installed. - Default
contextWindowsymbol 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-testand--demoCLI flags for verifying rendering without launching Claude Code.nerdFontconfig field andNERD_FONT/CLAUDE_CODE_STATUSLINE_NERD_FONTenvironment 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
softWrapconfig field andCLAUDE_CODE_STATUSLINE_SOFT_WRAPenv var (never read).noSoftWrapis 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
Fixes
- Handle empty stdin gracefully - exit silently with code 0 instead of throwing error
- Updated
readInput()to returnnullwhen stdin is empty/whitespace only
Full Changelog: v2.3.0...v2.3.1
v2.3.0
VPN Status Indicator (macOS only)
- Displays ◉ when VPN is connected, ○ when disconnected
- Independent toggle via
vpnIndicatorconfig option orCLAUDE_CODE_STATUSLINE_VPN_INDICATORenv var - Uses
scutil --nwito 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
realpathSyncfor correct path handling - Only fetch environment versions when
envContextis enabled to reduce overhead - VPN detection only runs when
vpnIndicatoris enabled - Fixed spacing when only VPN indicator is enabled
Full Changelog: v2.2.0...v2.3.0
v2.2.0 - Context Window Display Improvements
Changes
-
Context window display now shows remaining percentage instead of used
- Displays
≈76%(76% remaining) instead of24%(24% used) - Simplified implementation using API's
remaining_percentagefield directly - Changed ASCII fallback symbol from
#to≈for better semantic meaning - Aligns with bash statusline script approach
- Displays
-
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
Security & Bug Fixes
Security
- Fixed command injection vulnerabilities by replacing
exec()shell string interpolation withexecFile()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
- Affected files:
- Added
mode: 0o700to cache directorymkdir()for owner-only access
Fixed
- Unicode truncation now properly handles multi-byte characters (emojis, CJK)
- Rewrote
truncateText()andsmartTruncate()to usegetStringDisplayWidth() - Uses
Array.from()for proper grapheme cluster iteration
- Rewrote
- Replaced synchronous
readFileSync()with asyncreadFile()for stdin
Full details: See eval-002 comprehensive code review
🤖 Generated by Claude Code - GLM 4.7
v2.1.6
What's Changed
Fixed
- Context window percentage now matches
/contextcommand output- Prioritizes
current_usage(current API call) overtotal_input_tokens(cumulative session) - Resolves discrepancy where statusline showed 17% while
/contextshowed 0% - See: anthropics/claude-code#19724
- See: anthropics/claude-code#18944
- Prioritizes
🤖 Generated by Claude Code - GLM 4.7
v2.1.5 - Context Window Bug Workaround
What's Changed
Fixed
- Added workaround for Claude Code v2.1.8+ bug where
current_usagefields are all zeros andused_percentageis incorrectly set to 0- Now calculates from
total_input_tokensas fallback - Maintains backward compatibility with v2.1.7 and earlier
- Ready for future Claude Code versions where
used_percentagemay be fixed
- Now calculates from
Related Issues
- anthropics/claude-code#19724 - Confirms bug started in v2.1.8
- anthropics/claude-code#18944 - Documents the workaround calculation
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
Fixed
- Context percentage now displays correctly with Claude Code v2.1.15+
- Added support for new
context_window.used_percentagefield - 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→ Shows43%(rounded) - Without
used_percentage(legacy) → Shows8%(calculated fromcurrent_usage)
v2.1.2 - Model String Wrapping Fix
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 [!?]\nglm-4.6 ⚡︎40%
🤖 Generated by Claude Code - GLM 4.6