Repository navigation
Releases
Releases · Belkins/belkins-usage-bar
v1.4.1 — macOS 26 sentence-wrap portability
Fixed\n\n- Native capacity-menu sentence wrapping now accepts macOS AppKit's valid whole-word breakpoint while preserving the complete sentence and each menu layout's indentation contract.\n- The panel version is 1.4.1.\n\nThe attached zip is the allowlisted unsigned distribution package described by the repository release plan.
v1.3.2 — menu rebuild memory leak fix
What's Fixed
The panel no longer leaks memory on every menu rebuild (cc_usage_widget/bridge.py, card_base.py, render.py, app.py)
- PyObjC keeps a Python
strfor the life of the process when the same object is passed to Objective-C a second time before the autorelease pool drains, whether or not the callee keeps it. Reproduced with Foundation alone on PyObjC 11.1, 12.2.2, 13.0 and 13.1 (Python 3.13). - A menu rebuild did that to every block: its tooltip went to its view and to its menu item, and its label was measured, used as the item's title and set as the accessibility label. Present since the card layouts of 2026-09-25.
bridge.ns()now builds anNSStringfrom the text's UTF-8 bytes, so the Python string never crosses and the result can be handed over any number of times.- Measured in a fresh process, per rebuild of the whole menu: the default layout left 94.6 KB and 169 strings behind before the fix and 0.8 KB and 0.1 after it; Cards 7.7 KB before and 1.2 KB after; Glance 2.8 KB before and 1.7 KB after.
- Seven tests pin it (
tests/test_bridge.py): six fail without the fix, and the seventh reads the source so that no call site can lose the helper unnoticed.
Update
bswap updateA panel that has been running for days holds the leaked memory until it restarts, which the update does.
v1.3.1 — menu-bar memory leak fix
What's Fixed
1. The panel no longer leaks memory on every title-fit check (cc_usage_widget/menubar.py)
- Since the title-fit fallback of 2026-09-30,
menubar._window_list()boundCGWindowListCopyWindowInfothroughobjc.loadBundleFunctionswith the bare(name, signature)pair, so PyObjC never released the owned array a Core Foundation Copy function returns. The check runs every 2 to 3 seconds and each call left the whole window list behind: about 320 KB with 757 windows, roughly 420 MB an hour. - A panel that had been up 21 h 37 min measured 9,015 MB of physical footprint against the README's 55–85 MB. Nearly all of it was compressed, so
psshowed only about 170–230 MB and the growth went unnoticed. - The binding now declares the result as already retained (
_WINDOW_LIST_SPEC). In a fresh process, 300 calls grew the footprint by 93.8 MB before the fix and by 0.0 MB after it; 3,000 calls after it stayed flat. - Two regression tests pin it: the binding metadata, and the reference count against a deliberately bare control binding.
2. Tests and CI
tests/test_resets_cli.pyno longer depends on the date or the hour (test-only): its clock was pinned to 2026-11-21, and one test passed only before 12:54 local time.- The CI workflow now runs on
macos-26. GitHub retired themacos-14image, and every run since 2026-11-10 had been cancelled before it started. This release is the first since then to be tested here.
Update
bswap updateThe update restarts the panel, which releases whatever a long-running copy has already leaked.
v1.3.0 — Unified Fleet Reset Radar, banked Codex reset credits & 7-day capacity forecast
What's New
1. Pure Zero-I/O Unified Fleet Reset Radar Engine (cc_usage_widget/resets.py)
- Added
build_fleet_reset_radar()(ResetEvent,ResetCreditAccount,ResetCreditsSummary,FleetCapacitySummary,FleetRecommendation,FleetResetRadar) as a stdlib-only domain engine unifying Claude (5h,7d,Fable/Opus/Sonnet) and Codex (5h,7d) reset timelines. - Tracks banked Codex reset credits (
total_available,live_available,total_usable), computes aggregate effective fleet capacity equivalents (ready / cooling / re-login), and generates deterministic privacy-safe advisor recommendations (use_reset_credit,burn_perishable,unlock_soon,relogin_capacity,healthy).
2. Belkins Menu-Bar ↺ Reset Radar, Next-Unlock Chip & Smart Alerts (themes/belkins.py, app.py, contracts.py, notify.py)
- Added an interactive
↺ Reset Radarcard in the Belkins Hub with a Fleet Runway strip, banked Codex↺ N×reset credits badge, clickable perishable (⏳ USE) & upcoming unlock (🔓 UNLOCK) timeline, andShow all/Compactexpand toggle. - Added per-row reset countdown clocks (
↺ 4d,Capped · 3h) and banked Codex↺ USE N×/↺ N×pills on the Claude and Codex party tabs. - Added opt-in
title_show_next_unlock(🔓3h/🔓45mmenu-bar chip when a capped Fable/Codex seat unlocks within 24h; off by default) andreset_imminent_alert_enabled(default on) for ledger-deduped imminent-unlock (<= 15m) and high-usage Codex reset-credit (>= 90%with banked credits) alerts.
3. Offline HTML Command Center — 7-Day Reset Swimlane Gantt (dashboard.py)
- Added a Fleet Reset Timeline & Capacity Forecast section to the standalone offline HTML dashboard featuring a 4-card KPI strip (Effective Capacity, Next Unlock, Perishable Quota, Banked Codex Reset Credits), Smart Fleet Advisor callout, pure inline 7-day SVG swimlane Gantt chart, and chronological schedule table (HTML-escaped, email-free).
4. Unified bswap resets [--json] CLI & TUI Integration (bswap_cli.py)
- Added
bswap resets [--json](aliases:schedule,calendar,unlocks) showing live Claude + Codex reset countdowns, banked Codex reset credits, effective fleet capacity, and advisor recommendations. - Integrated compact Reset Radar summaries into
bswap status,bswap doctor,bswap watch, and the interactivebswapTUI.
Verification
- 878 / 878 tests passing across all 31 test suites (including bare stdlib Python without
claude_swap, privacy checks, and packaging verification). - Update existing installs: run
bswap update(orbelkins update).
v1.2.0 — Fable Guard, predictive Fable pre-switching, latch recovery UX & bswap doctor
Highlights
- Fable Guard (
belkins_fable_guard, ON by default): Automatically excludes non-Fable Team/Pro seats (reportingscoped = ()) fromAutoSwitchEngine,Switch to best now/⚡ Best,bswap best,bswap claude, ready room counts, and Hub top-2 standby previews — preventing Claude Code2.1.329from hittingmodel_requires_usage_creditsand tripping its permanent in-memory usage-credits latch. Non-Fable seats remain explicitly selectable via manual clicks and are taggedNO FABLEin the Belkins UI. - EWMA Fable Burn Velocity & Predictive Pre-Switching: Tracks live per-slot Fable burn velocity (
pct/min) and time-to-wall ETA across snapshots; dynamically lowers proactive switch ceilings (88%default, down to75%floor under fast multi-tab burn>= 0.8%/min) with a tight concurrency-scaled busy ceiling (<= 91.5%) and90shard hold timeout, plus immediate release on>= 3%single-tick Fable jumps. - Real-Time Latch & Rate-Limit Detection + Instant Recovery: O(1) 16 KiB tail-scan (
fleet.detect_session_interruptions) detects local rate-limit hits (triggering immediate failover on the same tick vianotify_local_limit_hit) and Claude Code usage-credits latches (⚡ LATCHED+ 1-clickCopy Resumepill in Belkins Active Sessions + deduped macOS/Telegram alerts). - Manual-Switch Grace & Atomic Credit-Cache Cleanup: Grants a
180sgrace window on explicit manual switches (still bypassed at>= 99%) and atomically clears stalecachedExtraUsageDisabledReasonfrom~/.claude.jsonon switches onto healthy seats. - Diagnostics & Auto-Healer CLI: Adds
bswap doctor [--fix]andbswap fable-guard [on|off|status]. - 830 tests passing across 27 suites. See
CHANGELOG.mdfor full details.
Update existing installs with bswap update (or belkins update).
v1.1.0 — Fable auto-switch, turn-boundary guard, ROI forensics & macOS 26 menu-bar resilience
Highlights
- Per-model (
Fable/Opus/Sonnet) Auto-Switch (accounts.py,bswap_cli.py): Auto-seedsautoswitch.model = "all"when unconfigured, migrates legacy98%weekly thresholds to a safe92%proactive cushion (300scooldown), wakesevaluate_autoswitch()immediately on>= 99%windows, and addsbswap model [all|Fable|off]+bswap threshold [5h] [weekly]. - Turn-Boundary Preserved-Thinking Guard & Stale Busy Filter (
accounts.py,fleet.py): Holds mid-turn cross-org switches up to concurrency-scaled ceilings, executes sub-second turn-boundary handoffs when turns complete, and ignores stale (> 5m) lingeringbusysession files from open background shells. - macOS 26 (Tahoe) Menu-Bar Visibility & Notch Recovery (
menubar.py,app.py,__main__.py): Matcheswin.frame()directly against WindowServer layer-25 strip bounds instead of proxyocclusionState(), migrates legacy notch-clipped status-item positions (>= 1800pt), and adds two-tier (full->compact->icon-only) self-healing compaction. - Pricing, Multi-Root Indexing & Subscription ROI Dashboard (
pricing.py,indexer.py,codex_indexer.py,dashboard.py,history.py): AddsFable 5.2pricing, multi-profile transcript discovery, safe Codex auth token-sync switching, live project repricing, prompt-cache efficiency breakdown, and 30-day Subscription ROI (bswap roi). - 802 tests passing across 24 suites. See
CHANGELOG.mdfor full details.
Install or update:
- Existing installs:
bswap update(orbelkins update) - Fresh install:
git clone https://github.com/Belkins/belkins-usage-bar.git ~/.claude/cc-usage-widget && cd ~/.claude/cc-usage-widget && ./install.sh --launch-agent --reload
v1.0.4 — honest expired-quota rendering
A quota window whose reset instant has passed now renders as overdue, never as a live percentage — provoked by a real 4-day incident where a capped Codex account kept showing "100% (!), resets Aug 20" after Aug 20 had passed. Quota samples older than 2h show their age. 57 tests. See CHANGELOG.md.
Install: download the zip below, then unzip && cd cc-usage-widget && ./install.sh && ./run.sh