usage

usage 0.30.18

工具與目錄
在這頁

新功能 3 項

01

HTML 報表換新版面,圖表文字從 9px 放大到 12px

打開 usage 產出的 HTML 報表,現在每個區塊都收進外框一致的儀表板卡片裡。以前整頁報表只靠細線分段,頁面一長很難看清哪裡是哪裡;現在上方四張摘要卡共用同一個三列格線,數字整齊切齊。內文與數值一律換成無襯線字體配等寬數字,等寬字體只留給頂部的指令與 [usage]> 前綴。整體色調轉為中性,token(AI 處理與計費的文字單位)用量不再是土黃色,綠色則專門留給趨勢與尖峰。圖表上的文字也同步變大,坐標軸標籤從 9px 放大到 12px、圖例從 .7rem 放大到 .8rem,時段軸與熱力圖的月份及星期標籤都變大了,解決以前在普通螢幕上看不清的困擾。⟦就像展覽的導覽手冊,以前整本只用幾條細線隔開長篇文字,現在改成一張張分好類的解說牌,字也印大了,站遠一點也看得清。⟧

官方原文

**The HTML report is laid out as dashboard cards.** Each section sits in a card of the same shape instead of being split by thin rules, which were hard to follow down a long page. Body text and numbers share one sans-serif face with tabular figures; monospace is kept for the [usage]> prefix and the command line at the top. The palette is neutral, token counts are no longer amber, and green is kept for trends and peaks. The four summary cards share one three-row grid, so their numbers line up.

**Chart labels in the HTML report are larger.** Axis labels went from 9px to 12px and legends from .7rem to .8rem, and the hour axis and the heatmap's month and weekday labels grew with them. The old sizes were unreadable on an ordinary screen.

02

報表測試時間一律固定為 UTC,排除時區不同造成的驗證失敗

這是給開發者的修正,一般使用者不會感覺到差別。以前有 6 支報表測試只能在時區設為 UTC 的電腦上通過,導致線上持續整合(CI,自動驗證程式的機制)明明是綠燈,開發者在 UTC+8 的 Windows 電腦上跑測試卻固定失敗。這是因為程式先前直接在行內轉換工作階段的開始時間,測試環境沒辦法把時間固定住;現在這段時間轉換邏輯獨立了出來,讓測試能把時間基準牢牢鎖在 UTC,軟體本身的功能與行為則完全維持不變。⟦跨國線上大考一律以格林威治標準時間出題與收卷,不再拿各地考生的手錶時間當標準,評分就不會因為考生住在不同時區而判錯。⟧

官方原文

**Report tests pin session start times to UTC.** Six report tests passed only on UTC machines, so CI stayed green while they failed on Windows at UTC+8. Session start times were converted with an inline .astimezone() the tests could not replace; that conversion is now _session_start_text(), and the fixtures pin it to UTC next to _entry_date. Behavior is unchanged. (#144)

03

官網視覺排版重整,手機更好點按並加入面板預載圖

逛 usage 官方網站時,現在用手機點選連結或按鈕順手多了。首頁功能區改用三排圖文左右交錯呈現,分別介紹各工具額度、HTML 報表與外觀主題,其餘功能則整理成雙欄卡片,原本獨立的報表區塊也直接併入第二排。進度管家改採紙卡質感呈現,主題預覽外框會跟著面板高度自動縮放,短面板下方不再留下一大塊尷尬空白,安裝教學則移到頁面最下方。⟦翻開重新裝訂的產品型錄,主力商品圖文並茂排在最前頭,其餘項目整齊收進小格子,按鈕也加大防誤觸,讀起來清爽多了。⟧頂部導覽列、手機複製按鈕與頁尾連結都放大了點擊有效範圍,而且面板預覽在載入完成前會先顯示靜態預載海報,中文網頁也配上中文版海報。

官方原文

**Website visual refresh.** The feature section alternates image and text in three rows (quota for every tool, the HTML report, themes) with the remaining features as two-column cards, and the standalone report section merged into the second row. The pacing section is a paper card, the theme preview sizes its frame to the panel so short panels leave no empty space, and install moved to the end. Nav links, the mobile copy button and footer links have larger tap targets, and panel previews show a static poster until they load, in Chinese on the Chinese pages.

修正 1 項

04

Windows 上切換 Claude 帳號不再殘留前一個人的額度

家裡或公司共用一台 Windows 電腦,各自登入不同的 Claude 帳號?Claude Code 會把查到的用量額度存在 ~/.claude.json 檔案中,並在快取(把查過的結果暫存起來直接用)裡標註抓取時的帳號名稱;只要一換帳號,Claude Code 就會自動忽略該筆暫存。以前 usage 讀取檔案時沒有檢查這個帳號標籤,而 Windows 上查詢 Claude 額度又主要仰賴這份快取,才導致換了帳號卻依然顯示前一位使用者的剩餘用量。現在只要發現帳號不符就會主動跳過該快取;至於舊版 Claude Code 寫入、沒有帶帳號標籤的快取資料,依然會正常讀取。⟦像到洗衣店取件,店員會先核對單據上的名字,名字不是你,就不會把上一位客人的衣服交給你。⟧

官方原文

**Switching Claude accounts no longer shows the previous account's quota on Windows.** Claude Code tags the quota it caches in ~/.claude.json with the account that fetched it and ignores the cache after a switch. usage did not check the tag, and on Windows that cache is the main source of Claude quota. A cache from another account is now skipped. Caches written by older Claude Code versions carry no tag and are still read.