Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 2.45 KB

File metadata and controls

43 lines (33 loc) · 2.45 KB

Changelog

Notable changes to cc-statusline. Format based on Keep a Changelog.

[0.1.0] - 2026-06-15

Initial public release.

Features

  • GLM (Zhipu) plan usage: 🔋 5h token, 📅 weekly quota, 🔧 MCP tool calls (monthly); reads the Zhipu monitor directly with file-level TTL caching and three-tier fallback.
  • Live session metrics (all computed from the local transcript, zero network):
    • 🧠 context-usage progress bar
    • ⏱ model work time (sum of each turn's trigger→done, excluding user idle)
    • 💬 turns (deduped by message.id)
    • 🎯 cache hit rate (session-cumulative, inverted coloring)
    • 🚀 output throughput t/s (last 60s, per-request)
    • 🔄 RPM / TPM (last 60s)
  • git segment: 🌿 branch + dirty + ahead/behind, 📝 uncommitted-change count (live).
  • Coloring & layout: usage green/yellow/red, cache-hit inverted coloring, urgent remaining-time alerts; CCSL_SEP custom separator.

Configuration

Environment variables prefixed CCSL_:

Variable Description
CCSL_GLM_TOKEN Zhipu Open Platform API key (required; without it only local segments render)
CCSL_GLM_BASE_URL default https://open.bigmodel.cn/api
CCSL_CACHE_TTL cache seconds, default 120
CCSL_CACHE_DIR cache directory, default ~/.claude/cc-statusline
CCSL_MCP_LIMIT overrides the 🔧 MCP tool-call cap
CCSL_SEP segment separator, default |
CCSL_DEBUG 1 enables debug logging

Design notes

  • ⏱ work time ≠ session wall-clock: sums each assistant turn's trigger→done span, excluding idle while the user is away/thinking; /new opens a fresh transcript and resets.
  • 🚀 t/s is per-request: Σoutput / Σ(message first→last ts span) within the window — the denominator counts only actual generation time (excludes inter-message thinking gaps); hidden when span is all zero (divide-by-zero guard, no silent fallback).
  • 🎯 is session-cumulative (not windowed) for more stable long-term results.
  • Three-tier fallback: fresh cache → single fetch (no retry) → stale cache fallback (marked ⚠ stale) → empty snapshot; ⚠ cfg flags a config-load failure.
  • DNS resilience: sets RES_OPTIONS=timeout:2 attempts:2 by default to mitigate fetch timeouts caused by the first nameserver stalling (respects an existing value).
  • Explicit stdout flush: the statusline is a pipe, so output never stalls in a buffer.