usage

usage 0.30.12

工具與目錄
在這頁

新功能 3 項

01

自訂 Claude Code 設定路徑處處生效,狀態列與專案用量不再空白

如果你搬移了 Claude Code 的設定資料夾,狀態列與專案用量現在處處都能正常讀取。⟦這好比工作室搬遷後,公文仍投進舊信箱,讓新辦公室的值班看板始終查無進度。⟧先前「設定狀態列」仍寫進 ~/.claude/settings.json,Claude Code 根本不讀,兩條額度長條圖停在 0% 且標記「即將重置」;備援機制甚至翻出過期的 ~/.claude.json,且從 Finder 或 Dock 開啟的桌面程式抓不到終端機變數,專案用量一片空白。

``` # 路徑解析順序(逗號分隔時讀取全部、寫入第一筆): # 1. 環境變數 CLAUDE_CONFIG_DIR # 2. launchctl getenv CLAUDE_CONFIG_DIR # 3. 預設路徑 ~/.claude

# 跟隨變數搬移:settings.json, .claude.json, projects/ # 固定留在原處:狀態列腳本, usage-status.json, 偏好設定 ```

新版 loaders/claude_paths.py 依序解析目錄,Claude Code 檔案跟著走,而 usage 自己的檔案固定留在原處,避免子行程與桌面端分頭讀寫造成錯位。

官方原文

**CLAUDE_CONFIG_DIR is respected everywhere, not only for transcripts** ([#129](https://github.com/aqua5230/usage/issues/129)). With a relocated Claude Code config dir, "Set Up Status Line" wrote to ~/.claude/settings.json, which Claude Code never read, so both quota bars sat at 0% with "Reset imminent", the fallback surfaced a stale ~/.claude.json, and Project Usage stayed empty because an .app launched from Finder or the Dock does not inherit the shell environment. A new loaders/claude_paths.py resolves the directory from the environment, then launchctl getenv CLAUDE_CONFIG_DIR, then ~/.claude; comma-separated values are read in full and written to the first entry. Files Claude Code owns follow it — settings.json, .claude.json (inside the directory whenever the variable is set, the same rule Claude Code uses), and projects/. usage's own files — the statusline script, usage-status.json, prefs — stay pinned to ~/.claude: the script runs as a Claude Code subprocess and sees the variable while the app may not, and deriving both from it would let them write and read in different places.

02

報表週趨勢長條支援懸停顯示,標註日期區間與花費

打開用量報表查看每週趨勢長條時,滑鼠移過去現在會即時浮現日期區間與花費。⟦這有如專案白板上的進度橫條,湊近細看才能得知起訖日期與開銷明細,且剛進行三天的當週絕不會虛報成整整七天。⟧以前每列長條只標記 Token(AI 處理與計費的文字單位)數量,完全看不出那是哪一週、花了多少費用。新版在滑鼠懸停時補齊了具體時間與金額,顯示的日期區間也會嚴格限制在報表的實際範圍內,讓還沒過完的最後一週不會宣稱涵蓋七天、旁邊卻只有三天的數據。

官方原文

**Weekly trend bars in the report show their date range and cost on hover.** Each row only carried a token count, with no way to tell which week it was or what it cost. The range is clamped to the report's actual span, so an unfinished last week does not claim seven days next to three days of numbers.

03

報表洞察備忘改為方角無框,對齊全列填色風格

報表底部的洞察備忘(提供用量趨勢與分析提醒的備忘列),現在全面改為方角、無外框的淡色整列。它們原本是整個報表介面中最後一處還帶有外框的表面,帶有 8px 圓角與 3px 左側色條,現在已改為與報表其餘整列填色完全一致的視覺風格。⟦整張介面有如筆記本排版,當所有章節內容都已換成清爽的無框滿版底色時,最後一個帶有外框與側邊色條的便簽也同步抹平框線,讓整頁閱讀動線不再突兀。⟧

官方原文

**Insight notes in the report are square, borderless tinted rows.** They were the last framed surface left — 8px corners and a 3px left stripe — and now match the report's other full-row fills.

修正 1 項

04

狀態列 Token 在單位邊界不再顯示 1000k,並補齊十億級距

在狀態列查看消耗進度時,若 Token(AI 處理與計費的文字單位)數值剛好逼近單位邊界,現在不再顯示彆扭的 1000k。⟦這種尷尬宛如汽車儀表板的里程計數器,在行駛累積到九百九十九點五公尺時本該跳轉為一公里,卻因提早進位而顯示出一千公尺;重新對準門檻後,大單位才會準時接棒切換。⟧過去三支狀態列腳本在數值達到 1,000,000 時才升級為 M,但 k 是整數格式化,999,500 以上會先四捨五入成 1000k;腳本也沒有 B 級距,使得 15 億被印成 1500.0M。現在門檻改為比對進位後的邊界(k 到 M 用 999,500、M 到 B 用 999,950,000)並補上 B 級距,對齊 ui/tables.py 既有的正確寫法。

官方原文

**Token counts no longer read 1000k at a unit boundary.** The three statusline scripts promoted to M at value >= 1_000_000, but k is formatted :.0f, so anything from 999,500 rounded to 1000k first; there was no B step either, so 1.5 billion read 1500.0M. The thresholds now compare against the rounded boundary (999,500 for k→M, 999,950,000 for M→B) and a B step was added, matching the already-correct version in ui/tables.py.