繁體中文

新功能

HTML 報表內建互動日期切換,外寄檔案免裝 app 隨開即查

將匯出的 HTML 報表寄給同事或主管時,對方現在打開網頁就能自由挑選想看的日期範圍。

過去報表在產生的那一刻就把區間寫死,收到檔案的人完全無法切換視角;若要改看上週數據,只能請你重跑一次指令。新版直接將約 80 KB 的「日 × 工具 × 模型 × 專案」彙總表嵌入網頁中,所有牽涉日期的區塊都在瀏覽器內即時計算。頁面上方設有吸頂日期列,提供五個快捷範圍與自訂起訖日;不需安裝 app 也不必重新產檔,分享出去的檔案依然能完整操作。至於那些固定觀察特定天數的區塊,介面也會清楚標明涵蓋範圍,避免切換日期時讓人誤以為畫面故障。

新功能

清理對話紀錄不再遺失用量歷史,快照持久化小計與花費

刪除舊的對話紀錄釋放硬碟空間,歷史報表不再跟著消失。過往報表每次都從 ~/.claude/projects 與 ~/.codex/sessions 重算,這些紀錄每月約增長 1.9 GB,清掉舊檔等於抹平歷史。新版將小計以工作階段、日期、工具、模型與專案五個維度存入 ~/.usage/usage_snapshot.json 快照檔,並記錄各工作階段(session)的開始時間與時長,排行榜也能救回。若某天讀取的 token(AI 處理與計費的文字單位)少於快照,當天改由快照還原;已存花費原樣沿用,不依今日價格重新計價。實測今天、本週、最近 7 天、本月與全部五個範圍,模擬紀錄全刪與完整留存產出的報表,除產生時間外逐字相同。

新功能

報表依閱讀動線重新排版,視覺降噪並最佳化手機瀏覽

用量報表打開後,版面按閱讀順序重排。

順序是摘要卡、用量趨勢、工具、專案、高花費工作階段、固定週期群組、計算方式、年度回顧。主力模型區塊因重複工具數字而移除;工具列可展開模型,切換日期後保持展開;專案甜甜圈圖因重複排行而刪除。每週燃燒趨勢改名為「用量趨勢」。token(AI 處理與計費的文字單位)組成、快取命中率與花費可信度收進折疊的計算卡,五個 fixed range 標籤變成群組上方說明。色條改成底緣 2px 細線,只有 token 數字維持黃色;摘要卡獨立成圓角框,先顯示縮寫數字,下方列精確數字。區塊間距、標題大小與左右邊界也統一,可展開列滑過會高亮。手機上專案一行、工具兩行,工作階段表格橫滑,熱圖保留可讀格子並自動捲到最新週數。開頭摘要移除專案數,因非 git 資料夾與重播歷史會墊高數字。

新功能

新增每日用量堆疊圖與花費可信度,工具分色不再混淆

想看清各家 AI 每天的花費與用量節奏,報表新增了直觀的每日用量圖表。圖表每天顯示一根堆疊長條並依工具分色,右上角提供 Tokens 與花費切換開關,滑鼠懸停即可檢視當日用量細項,切換日期時也會跟著重新繪製。為了讓各家工具一目了然,Grok 的代表色改為粉紅色,徹底解決過往綠色與相鄰 Claude 綠色混在一起難以分辨的困擾。此外,報表增設「花費可信度」標記,明確列出有多少比例的用量具備公開價格、多少沒有,並直接點名缺乏公開報價的模型。介面也明白告知讀者,統計顯示的金額是依公開價目表折算的 API 等值花費,並非你的訂閱制月租帳單。

問題修復

Claude 子目錄工作階段依 Git 歸屬專案,快取擴大防止重複查詢

在專案子資料夾啟動 Claude,用量現在會正確歸入同一個母專案。過去 adapters/claude.py 處理工作階段(session)只取路徑最後一層名稱,導致 tests/、docs/ 或 panels/ 都被誤算成獨立專案。新版改用與 Codex、Grok 及 Antigravity 相同的 resolve_project_name() 判斷 git 根目錄。為了避免多個工具的資料夾加總後反覆呼叫 git,共用快取(cache,把查過的結果暫存起來直接用)上限從 256 筆調升至 2048 筆。只能從小計快照還原的舊日期,則沿用當時記下的資料夾名稱。

問題修復

報表修復排版與圖表比例,校準前期統計與混合計價

瀏覽 HTML 報表時,多項版面與統計問題已修正。前期比較不再算到資料起始日之前,排除了如 ↑2799% 的假成長;工具分組混到未定價模型也不再把整組花費隱藏成 —,Antigravity 曾被藏起的 $166 現已正常顯示。因 .rank-line 的 display:grid 權重高於瀏覽器 [hidden] 導致收合失效的問題已排除,收合列會確實收起;.tokens-cell 補上 position:relative,工作階段(session)排行的長條不再全疊在頁面左上角;展開的模型子列修正尺規,不再把專案佔比套用總量尺度,避免佔專案 68.7% 的模型看起來比專案本身大三倍。

English

FEATURE

HTML reports now feature interactive date filtering, letting recipients explore data instantly without installing an app

When emailing an exported HTML report to teammates or managers, recipients can now freely select the date range they want to inspect right on the page.

Previously, the report locked its timeframe at generation time, leaving recipients unable to adjust the view; switching to last week's numbers meant asking you to rerun the command. The new version directly embeds an ~80 KB summary table of "day × tool × model × project" into the page, and every date-dependent section recalculates live in the browser. A sticky date bar at the top provides five shortcut ranges and a custom from/to range. No app or regeneration is required, keeping shared files fully functional. Sections covering a fixed number of days clearly indicate their span, preventing users from assuming the view is broken when switching dates.

FEATURE

Cleaning up transcripts no longer erases usage history, with snapshots persisting totals and costs

Deleting old conversation transcripts to free up disk space no longer wipes out historical reports. Previously, reports recomputed everything from ~/.claude/projects and ~/.codex/sessions, which grow by roughly 1.9 GB each month, so clearing old files meant erasing history. The new version saves subtotal snapshots across five dimensions—session, date, tool, model, and project—into ~/.usage/usage_snapshot.json, while also recording each session's start time and duration so rankings survive. If a given day's loaded tokens are fewer than in the snapshot, that day is restored from the snapshot. Saved costs are kept as-is rather than repriced against today's prices. In tests across five ranges—today, this week, last 7 days, this month, and all—reports generated with transcripts fully kept versus simulated as completely deleted were byte-identical, except for generation time.

FEATURE

Report layout reorganized around reading flow, reducing visual noise and optimizing mobile viewing

When opening the usage report, the layout is now rearranged in reading order.

The sequence is now summary cards, usage trend, tools, projects, costliest sessions, fixed-span group, calculation details, and Year in Review. The main model section was removed because it duplicated tool numbers; tool rows can expand to reveal models and remain open after switching dates; the project donut chart was removed for repeating ranking data. "Weekly burn trend" is renamed to "Usage trend". Token composition, cache hit rate, and cost confidence are tucked into a collapsed calculation card, while five "fixed range" tags became a single note above their group. Colored bars were replaced with 2px lines along the bottom edge, with only token figures keeping their yellow color. Summary cards are separate rounded boxes that display abbreviated numbers first, followed by exact figures underneath. Section spacing, heading sizes, and horizontal margins are unified, with expandable rows highlighting on hover. On mobile, projects take one line and tools take two lines, session tables scroll horizontally, and the heatmap retains readable grid cells while automatically scrolling to the latest weeks. The opening summary removes the project count, as non-git folders and replayed history inflate the figure.

FEATURE

New daily stacked usage chart and cost confidence, with distinct tool colors eliminating confusion

To provide clear visibility into daily spending and usage pacing across different AIs, the report adds an intuitive daily usage chart. The chart displays a stacked bar per day colored by tool, featuring a Tokens/Cost toggle in the top-right corner and hover tooltips for daily breakdowns, automatically redrawing when the date range changes. To make each tool instantly recognizable, Grok's color is changed to pink, resolving the issue where its previous green blended into the adjacent Claude green. In addition, the report introduces a "Cost confidence" badge that specifies the exact proportion of usage backed by public pricing versus unpriced usage, explicitly naming models without public rates. The interface also clearly informs readers that reported costs represent API-equivalent values calculated from public price lists rather than subscription bills.

BUGFIX

Claude sessions in subdirectories attributed to parent repo via Git, with expanded cache preventing repeated lookups

Launching Claude inside a project subfolder now correctly attributes usage to the same parent project. Previously, adapters/claude.py handled sessions by taking only the last folder name in the path, causing tests/, docs/, or panels/ to be miscounted as standalone projects. The new version switches to resolve_project_name(), matching Codex, Grok, and Antigravity to determine the git root. To avoid repeated git calls when aggregating folders across multiple tools, the shared cache limit was raised from 256 to 2048 entries. Older dates that can only be replayed from subtotal snapshots retain the folder names recorded at that time.

BUGFIX

Report fixes layout and chart proportions, calibrating prior-period comparisons and mixed pricing

Several layout and statistical issues in the HTML report have been resolved. Previous-period comparisons no longer reach before the first day of data, eliminating artificial growth spikes such as ↑2799%. Tool groups mixed with unpriced models no longer hide their entire cost as —, properly displaying Antigravity's previously hidden $166. An issue where .rank-line's display:grid overrode the browser's [hidden] attribute has been fixed, ensuring collapsed rows actually collapse. Adding position:relative to .tokens-cell prevents session ranking bars from piling up in the top-left corner. Expanded model sub-rows now use corrected scaling rather than plotting project share on the total-volume scale, preventing a model accounting for 68.7% of a project from looking three times larger than the project itself.

原始 CHANGELOG

Original changelogHTML 報表內建互動日期切換,外寄檔案免裝 app 隨開即查
**The report's date range can be changed inside the page** ([#137](https://github.com/aqua5230/usage/pull/137)). The HTML report used to freeze its period at generation time, so a copy sent to someone else could not be explored. A day × tool × model × project table (about 80 KB) is now embedded, and every date-dependent section recalculates in the browser from five shortcuts or a custom from/to range in a sticky bar. No app and no regeneration are needed, so a shared file stays fully usable. Sections that always cover a fixed span say so, so they don't look broken when the dates change.
Original changelog清理對話紀錄不再遺失用量歷史,快照持久化小計與花費
**Report history survives transcript cleanup.** The report recomputed everything from `~/.claude/projects` and `~/.codex/sessions`, which grow by roughly 1.9 GB a month, so deleting old transcripts erased report history with them. Totals are now kept in `~/.usage/usage_snapshot.json` at (session, date, tool, model, project) grain, plus each session's start time and duration so the session ranking survives too. When a day's live transcripts hold fewer tokens than the snapshot, that day is replayed from the snapshot; stored costs are used as-is rather than repriced against today's price list. On real data, reports for today / week / last 7 days / month / all were byte-identical except for the generation time with transcripts present and with all of them simulated as deleted.
Original changelog報表依閱讀動線重新排版,視覺降噪並最佳化手機瀏覽
**The report is reorganised around what people read first.** Order is now summary cards → usage trend → your tools → projects → costliest sessions → the fixed-span group (heatmap, habits, recent work, insights) → how these numbers are calculated → Year in Review. The main-model section repeated the tools section's numbers exactly, so it is gone; each tool row now expands to show its models, and expanded rows stay open when the date range changes. The project donut repeated the ranking below it and was removed. "Weekly burn trend" is now "Usage trend". Token mix, cache hit rate and cost confidence live in a collapsed "How these numbers are calculated" card. The five "fixed range" tags became one note above the group they apply to.
**Visual pass across the report.** Filled bars behind ranking, tool, composition and weekly rows became 2px tracks along the bottom edge; only token figures stay yellow. Summary cards are separate rounded boxes that lead with the abbreviated number and show the exact count underneath. Section spacing and title sizes are consistent, every section shares one left and right edge, and expandable rows highlight on hover. On phones, a project is one line instead of four, a tool is two lines instead of four, the session table scrolls sideways instead of wrapping, and the heatmap keeps readable cells and opens scrolled to the latest weeks.
**The summary sentence no longer states a project count.** Projects are attributed by working folder, so non-git folders and replayed history still inflate the number enough to mislead.
Original changelog新增每日用量堆疊圖與花費可信度,工具分色不再混淆
**Daily usage chart.** A stacked bar per day, coloured by tool, with a Tokens/Cost toggle, a hover breakdown, and redraws when the date range changes.
**Cost confidence.** Shows how much usage has a public price and how much does not, names the unpriced models, and states plainly that cost is the API-equivalent value from public price lists, not a subscription bill.
**Grok is pink in the report.** Its previous green sat next to Claude's green in the stacked daily chart and the two could not be told apart.
Original changelogClaude 子目錄工作階段依 Git 歸屬專案,快取擴大防止重複查詢
**Claude sessions opened in a repo subfolder no longer count as separate projects.** `adapters/claude.py` used only the last folder name, so `tests/`, `docs/` and `panels/` each became a project. It now uses the same `resolve_project_name()` git lookup as Codex, Grok and Antigravity, and the shared cache grew from 256 to 2048 entries so several tools' folders together don't push it into repeated `git` calls. Days that can only be replayed from the snapshot keep the folder names recorded at the time.
Original changelog報表修復排版與圖表比例,校準前期統計與混合計價
**Previous-period comparisons no longer reach before the first day of data** ([#137](https://github.com/aqua5230/usage/pull/137)), which produced growth like `↑2799%`.
**A tool group with one unpriced model no longer hides its whole cost** ([#137](https://github.com/aqua5230/usage/pull/137)); Antigravity's $166 had been shown as `—`.
**Collapsed rows actually collapse** ([#137](https://github.com/aqua5230/usage/pull/137)). `.rank-line`'s `display:grid` outranked the browser's `[hidden]`, so collapsing changed the DOM but not the screen.
**Session ranking bars no longer pile up in the top-left corner** ([#137](https://github.com/aqua5230/usage/pull/137)); `.tokens-cell` was missing `position:relative`.
**Expanded model rows are no longer wider than their parent.** Child bars were drawn as share-of-project on the same scale as the parent's share-of-total, so a model at 68.7% of a project looked three times bigger than the project itself.