Skip to content

Commit 33fb352

Browse files
aqua5230claude
andcommitted
chore: release 0.14.0 — usage habits + Codex staleness hint
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 320254d commit 33fb352

5 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG.en.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Format follows [Keep a Changelog](https://keepachangelog.com/).
77

88
## [Unreleased]
99

10+
## [0.14.0] - 2026-06-01
11+
12+
### Added
13+
- **"Usage Habits" section in the HTML report**: fully local, zero API. The analysis report now shows a full-width 24-hour activity histogram of when you work, highlighting your peak hour with a plain-language summary ("You most often work with AI around HH:00 and HH:00"). Data comes from the message timestamps in your local Claude Code logs (user / assistant messages only) — **never the conversation content**. Parsing lives in a standalone `persona_loader.py` with a 300s TTL cache.
14+
- **"Stale data" hint on the Codex card**: when the local Codex usage snapshot is older than 15 minutes, the classic panel's Codex card shows an "about N minutes ago" tag plus an info (ⓘ) tooltip. Unlike Claude Code, Codex has no live status-line hook, so its usage numbers come from session logs it writes only intermittently and can lag your real account; the tooltip also explains that staying offline is a deliberate choice so it never burns your tokens. Built from the existing `rate_limits.updated_at`**no network, no API**.
15+
1016
## [0.13.0] - 2026-05-31
1117

1218
### Added

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
## [Unreleased]
88

9+
## [0.14.0] - 2026-06-01
10+
11+
### 新增
12+
- **HTML 報告新增「使用習慣」區塊**:純本地、零 API。在分析報告中以滿版 24 小時長條圖呈現你的活躍時段,標出最高峰並附一句白話總結(「你最常在 X 點和 Y 點與 AI 協作」)。資料取自本機 Claude Code 對話紀錄的訊息時間(僅計 user / assistant 訊息),**不讀對話內文**;解析邏輯獨立於 `persona_loader.py`,附 300 秒 TTL 快取。
13+
- **Codex 卡片「資料過期」提示**:當本機 Codex 用量快照超過 15 分鐘,classic 面板的 Codex 卡會顯示「約 N 分鐘前」標籤與一個 ⓘ 說明氣泡。Codex 不像 Claude Code 有即時回報的狀態列 hook,其用量來自偶爾才寫入的 session 紀錄、可能落後實際帳號;氣泡同時說明「維持離線是為了不多耗你的 token」。資料取自既有 `rate_limits.updated_at`**不連網、不呼叫 API**
14+
915
## [0.13.0] - 2026-05-31
1016

1117
### 新增

README.en.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Read priority:
6969

7070
Codex CLI doesn't expose a statusLine hook, so usage takes a different route: it scans the conversation logs Codex CLI leaves on disk (`~/.codex/sessions/*.jsonl`). Codex writes `rate_limits` data directly into each log entry — usage reads those fields to get the 5-hour and 7-day quota percentages directly. Today's token count and cost are summed from the token usage recorded in the same files.
7171

72+
Note that Codex only writes `rate_limits` into its logs **intermittently** — unlike Claude Code, it has no live status-line reporting — so this number can **lag your real usage** (and anything you do on the web never reaches the local files at all). When the local snapshot is older than 15 minutes, the Codex card shows an "about N minutes ago" tag to flag that it's stale. Staying offline is deliberate: it means usage never burns your tokens.
73+
7274
If Codex isn't installed or the directory doesn't exist, that part of the UI hides itself and Claude Code stats continue to work normally.
7375

7476
## Comparison

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ flowchart LR
6969

7070
Codex CLI 沒有 statusLine hook 這種機制,所以 usage 採另一條路:掃 Codex CLI 在 `~/.codex/sessions/` 底下留下的 `*.jsonl` 對話紀錄檔。Codex 每次對話會在紀錄裡寫入 `rate_limits`(配額資訊),usage 直接讀裡面的 5 小時跟 7 天用量百分比,不需要自己計算。今日的 token 用量跟成本則從同一份紀錄的 token 統計加總。
7171

72+
要注意的是:Codex 只是**偶爾**才把 `rate_limits` 寫進紀錄,不像 Claude Code 會即時回報,所以這個數字可能**落後你的實際用量**(在網頁上用的更不會進到本機檔)。當本機快照超過 15 分鐘,Codex 卡會標出「約 N 分鐘前」提醒你這是舊資料。維持離線是刻意的——這樣 usage 不會多耗你的 token。
73+
7274
沒裝 Codex 或沒這個資料夾的話,這部分會自動隱藏,不會影響 Claude Code 那邊的顯示。
7375

7476
## 跟其他工具比較

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "usage"
3-
version = "0.13.0"
3+
version = "0.14.0"
44
description = "usage — 在 macOS menu bar 顯示 Claude Code 用量的繁中小工具(也提供終端機 TUI)"
55
readme = "README.md"
66
requires-python = ">=3.13"

0 commit comments

Comments
 (0)