All notable changes to this project will be documented in this file.
- feat: 新增 Session Name 顯示與查詢功能
- 從 JSONL 中解析
custom-title和agent-name條目取得 session name session命令新增--session-idflag,依 UUID 精確查詢特定 sessionsession命令新增--session-nameflag,依 session name 精確查詢- Session 報表優先顯示 session name(無 name 時回退為 project path)
- 跨檔案全局回填 SessionName(subagent 檔案也能正確顯示)
- 從 JSONL 中解析
- feat: Session 過濾模式新增 Source File 明細
--session-id/--session-name查詢時,以 Session 為大區塊,逐行列出每個 Source File- 每個 Source File 獨立顯示 Models、Input、Output、Cache、Cost、Last Activity
- 一般模式維持 Files 數字欄不變
- feat: Daily/Monthly 報表新增 Sessions 數量欄
- 統計每個時間區間內的唯一 session 數量
- Footer 顯示總計唯一 session 數量
- feat: Session 報表新增 Session IDs 和 Source Files 追蹤
- SessionInfo 收集所有唯一 Session UUID 和 Source File 路徑
- CSV 輸出新增
session_name、session_ids、source_files欄位
- feat: Last Activity 欄顯示日期+時間(當地時區)
- feat: 所有報表新增 CC Cost / CR Cost / API Cost 獨立欄位
- Cache Create Cost 和 Cache Read Cost 分別顯示
- API Cost 只含 input + output 費用
- 舊版資料無 cache 時欄位顯示
-
- feat: Blocks 報表新增 token 和費用明細
- 從單一 Tokens + Cost 欄拆分為 Input / Output / Cache Create / CC Cost / Cache Read / CR Cost / Total Tokens / API Cost / Cost
- Gap 行和 REMAINING/PROJECTED 特殊行同步更新
internal/types/usage.go— 新增 SessionName、SessionIDs、SourceFiles、SourceFile、SourceFileStatinternal/loader/loader.go— 攔截 custom-title/agent-name、設定 SourceFile、全局 sessionNameMap 回填internal/commands/session.go— 新增 --session-id/--session-name flags、過濾模式調用 detail 報表internal/commands/shared.go— 新增 filterEntriesBySessionID/Name 輔助函式internal/calculator/calculator.go— GenerateSessionReport 收集 SessionName/SessionIDs/SourceFiles、新增 AggregateBySourceFileinternal/output/tablewriter_formatter.go— FormatSessionDetailReport、Session name 顯示、Sessions 欄、Last Activity 含時間和時區internal/output/formatter.go— CSV 格式加入 session_name/session_ids/source_filesinternal/types/usage.go— UsageEntry、SessionInfo、SourceFileStat 新增 CacheCreateCost / CacheReadCost 欄位internal/calculator/calculator.go— 分別計算 cache create / cache read 費用internal/output/tablewriter_formatter.go— 報表新增 CC Cost (USD) / CR Cost (USD) / API Cost (USD) 欄位
internal/loader/session_name_test.go— 6 tests (custom-title, agent-name, priority, empty, cross-file, source-file)internal/calculator/session_report_test.go— 6 tests (session name, multiple, empty, session IDs, source files, aggregate)internal/commands/session_filter_test.go— 5 tests (ID/name filter, no match, empty)internal/output/session_count_test.go— 7 tests (session name, session IDs, files column, detail report, CSV, daily/monthly sessions)
- perf: Add project-level incremental cache for
blocks --livemode- Tracks file state (ModTime+Size) per project directory
- Only reloads changed files; skips entirely when no changes detected
- Per-project deduplication for efficient append-only JSONL handling
- Full project reload on file deletion for cache consistency
| Metric | Before | After | Improvement |
|---|---|---|---|
| CPU avg (30s idle) | 26.7% | 8.5% | -68% |
internal/loader/project_cache.go— New incremental cache implementationinternal/loader/project_cache_test.go— 9 unit testsinternal/monitor/blocks_live.go— Integrated incremental cache into tick handler
- feat: Add LIMITS section to
blocks --liveshowing Claude API usage quota in real-time- Displays session (5-hour) and weekly limits with color-coded progress bars
- Green (≤60%), yellow (60-90%), red (>90%) indicators
- Shows reset times in local timezone
- Graceful degradation when no OAuth token or API unavailable
- feat: Add
internal/usagepackage for Claude OAuth Usage API integration- Cross-platform OAuth token reading (env var, credentials file, macOS Keychain)
- 5-minute in-memory cache with concurrent access protection
- fix: Fix model name display for dateless model IDs
claude-opus-4-6now correctly shows asOpus-4.6(wasclaude-opus-)claude-sonnet-4-6now correctly shows asSonnet-4.6(wasclaude-sonne)- Tightened date regex to require 8-digit dates, preventing false matches
- Updated README and README_ZH_TW for v0.11.0
- Updated blocks-live implementation docs with LIMITS section
- Updated API integration docs with Claude OAuth Usage API
- Updated live monitor screenshot
- feat: Add support for Haiku 4.5 model
- feat: Update pricing for Sonnet 4.5
- style: Standardize model display names to use hyphens (e.g.,
Sonnet-4.5)
- 90% reduction in peak memory usage during live monitoring (446MB → 46MB)
- 83% reduction in steady-state memory usage (263MB → 45MB)
- Implemented single-worker architecture for reduced resource consumption
- Stream processing with immediate memory release after cost calculation
- Smart retention of only essential cache token data
- Default static binary compilation with
CGO_ENABLED=0 - Binary size optimization with
-ldflags="-s -w"(14MB → 9.6MB) - Unified naming convention: all binaries now use
ccusage_goprefix - Simplified deployment with zero runtime dependencies
- Changed default
maxWorkersfrom 5 to 1 for lower CPU usage - Implemented progressive memory release during file processing
- Fixed token accumulation in live mode with proper cache token handling
- Aligned with TypeScript version's 24-hour retention window
- Updated Makefile with static compilation as default
- Enhanced GitHub Actions workflows for new naming convention
- Added
make dynamictarget for optional dynamic linking - Improved release automation with proper binary naming
| Metric | Before | After | Improvement |
|---|---|---|---|
| Peak Memory | 446 MB | 46 MB | -90% |
| Steady Memory | 263 MB | 45 MB | -83% |
| Binary Size | 14 MB | 9.6 MB | -31% |
| Process Count | 3 | 2 | -33% |
- Fixed memory leak in stream processing mode
- Corrected cache token accumulation in
IdentifySessionBlocks - Fixed process statistics in monitoring script for npm processes
- Resolved Raw data clearing issue that affected cost calculations
- Updated performance comparison tables with latest measurements
- Added detailed testing methodology documentation
- Enhanced installation instructions for v0.9.0
- Added monitoring script usage examples
- Binary output name changed from
ccusagetoccusage_go - Release artifacts now use underscore naming (e.g.,
ccusage_go-linux-amd64)
- No changes to external dependencies
- Maintained compatibility with Go 1.22+
Initial public release with core functionality:
- Daily, monthly, weekly, and session reports
- 5-hour billing blocks tracking
- Live monitoring mode with gradient progress bars
- JSON/CSV/table output formats
- Cross-platform support