繁體中文

新功能

自訂 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 自己的檔案固定留在原處,避免子行程與桌面端分頭讀寫造成錯位。

問題修復

狀態列 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(AI 處理與計費的文字單位)數量,完全看不出那是哪一週、花了多少費用。新版在滑鼠懸停時補齊了具體時間與金額,顯示的日期區間也會嚴格限制在報表的實際範圍內,讓還沒過完的最後一週不會宣稱涵蓋七天、旁邊卻只有三天的數據。

新功能

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

報表底部的洞察備忘(提供用量趨勢與分析提醒的備忘列),現在全面改為方角、無外框的淡色整列。它們原本是整個報表介面中最後一處還帶有外框的表面,帶有 8px 圓角與 3px 左側色條,現在已改為與報表其餘整列填色完全一致的視覺風格。

English

FEATURE

Custom Claude Code config paths take effect everywhere, keeping status lines and project usage from going blank

If you relocate Claude Code's configuration directory, the status line and project usage can now be read properly everywhere.

Previously, "Set Up Status Line" still wrote to ~/.claude/settings.json, which Claude Code never read, leaving both quota bars stuck at 0% with "Reset imminent"; the fallback mechanism even surfaced a stale ~/.claude.json, and desktop apps launched from Finder or the Dock could not catch terminal environment variables, leaving project usage completely blank.

# Path resolution order (reads all when comma-separated, writes to the first entry):
# 1. Environment variable CLAUDE_CONFIG_DIR
# 2. launchctl getenv CLAUDE_CONFIG_DIR
# 3. Default path ~/.claude

# Moves with the variable: settings.json, .claude.json, projects/
# Stays pinned in place: statusline script, usage-status.json, preferences

The new loaders/claude_paths.py resolves directories in order so that Claude Code files follow the variable while usage's own files stay pinned in place, preventing misalignment from subprocesses and the desktop app reading and writing in different locations.

BUGFIX

Status line token counts no longer show 1000k at unit boundaries, adding the billion step

When checking usage progress in the status line, token values near unit boundaries no longer display an awkward 1000k.

Previously, the three status line scripts only upgraded to M when reaching 1,000,000, but k used integer formatting, causing values of 999,500 and above to round up to 1000k first; the scripts also lacked a B step, causing 1.5 billion to be printed as 1500.0M. The thresholds now compare against rounded boundaries (999,500 for k to M, 999,950,000 for M to B) and add the B step, matching the existing correct implementation in ui/tables.py.

FEATURE

Report weekly trend bars support hover display, showing date ranges and costs

When viewing weekly trend bars in the usage report, hovering over them now reveals their date range and cost.

Previously, each row only marked token counts, with no way to tell which week it was or how much it cost. The new version provides the exact timeframe and amount on hover, and clamps the displayed date range strictly to the report's actual span so an unfinished last week does not claim seven days next to three days of numbers.

FEATURE

Insight notes in reports become square and borderless, matching full-row fill styling

Insight notes at the bottom of the report are now entirely square, borderless tinted full rows. They were originally the last framed surfaces left across the entire report interface, featuring 8px rounded corners and a 3px left stripe, and have now been updated to match the visual style of the report's other full-row fills.

原始 CHANGELOG

Original changelog自訂 Claude Code 設定路徑處處生效,狀態列與專案用量不再空白
**`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.
Original changelog狀態列 Token 在單位邊界不再顯示 1000k,並補齊十億級距
**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`.
Original changelog報表週趨勢長條支援懸停顯示,標註日期區間與花費
**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.
Original changelog報表洞察備忘改為方角無框,對齊全列填色風格
**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.