Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,18 @@ Commands:
- `watch` — live-updating view (`limits|today|week|models|sessions|hours`, default `limits`), refreshed on an interval
- `export` — export raw analytics; supports `--format json|csv` and `--output <path>` (defaults to stdout, JSON)

`watch`'s default view, `limits`, approximates the "Current Session" (rolling 5-hour window) and "This Week" usage panels shown in Claude's own account UI. Since the real reset times live on the Anthropic account and can't be read locally, they're estimated from local transcript timestamps unless pinned with `--session-reset "HH:mm"` (e.g. `--session-reset "18:30"` — just copy the reset time Claude itself shows) / `--week-reset "Ddd HH:mm"` (e.g. `--week-reset "Mon 09:00"`). When the session reset time has elapsed and this machine has no activity in the last 5 hours (the account may be idle, or in use on another device), the session row shows as unknown rather than a made-up countdown. The weekly reset is a fixed time assigned to your account, unrelated to activity, so it can't be derived locally at all — without `--week-reset` that row also shows as unknown, with the trailing 7 days of usage shown as an upper bound on the current cycle instead; that fixed time only needs to be entered once, unlike the session reset. Press `r` while `watch` is running to re-enter either reset time (Enter skips one and keeps the local estimate). If neither reset time is configured and you're in an interactive terminal, `watch` prompts for them once and remembers the answer in `%LOCALAPPDATA%/aimon/limits-settings.json` (or the OS equivalent) for future runs.
`watch`'s default view, `limits`, approximates the "Current Session" (rolling 5-hour window) and "This Week" usage panels shown in Claude's own account UI, including a **Time Progress** bar (how far each window has elapsed) and a **Token Progress** bar (how close the window is to its token budget). Since the real reset times live on the Anthropic account and can't be read locally, they're estimated from local transcript timestamps unless pinned with `--session-reset "HH:mm"` (e.g. `--session-reset "18:30"` — just copy the reset time Claude itself shows) / `--week-reset "Ddd HH:mm"` (e.g. `--week-reset "Mon 09:00"`). When the session reset time has elapsed and this machine has no activity in the last 5 hours (the account may be idle, or in use on another device), the session row shows as unknown rather than a made-up countdown. The weekly reset is a fixed time assigned to your account, unrelated to activity, so it can't be derived locally at all — without `--week-reset` that row also shows as unknown, with the trailing 7 days of usage shown as an upper bound on the current cycle instead; that fixed time only needs to be entered once, unlike the session reset.

Claude itself only ever shows a usage *percentage*, never the underlying token limit, so the Token Progress bar works the same way: pass `--session-token-progress <percent>` / `--week-token-progress <percent>` (e.g. `--session-token-progress 32` for "32%", copied from Settings > Usage or `/usage` in Claude Code) and `watch` derives a token budget from that percentage and the tokens it has counted for the window so far, then tracks the bar live against that budget without asking again.

Press `r` while `watch` is running to re-enter any of the four values — reset times and usage percentages (Enter on a prompt keeps its current value or local estimate). If any of the four aren't configured and you're in an interactive terminal, `watch` prompts for them once up front and remembers the answers in `%LOCALAPPDATA%/aimon/limits-settings.json` (or the OS equivalent) for future runs.

![watch --view limits](docs/images/watch-limits-screenshot.png)

### WPF dashboard (Windows only)

> **⚠️ Work in progress — not ready for use yet.** The WPF project is still under active development; expect missing features and rough edges. Use the CLI (`aimon`) for now.

```
dotnet run --project src/AIUsageMonitor.WPF
```
Expand Down Expand Up @@ -137,10 +145,18 @@ aimon <命令>
- `watch` — 实时刷新视图(`limits|today|week|models|sessions|hours`,默认为 `limits`),按指定间隔自动刷新
- `export` — 导出原始分析数据;支持 `--format json|csv` 与 `--output <path>`(默认输出到标准输出,格式为 JSON)

`watch` 的默认视图 `limits` 近似展示 Claude 官方账户界面中的 "Current Session"(滚动 5 小时窗口)和 "This Week" 用量面板。由于真实的重置时间存储在 Anthropic 账号侧,本地无法读取,默认会根据本地会话记录的时间戳估算;也可以用 `--session-reset "HH:mm"`(如 `--session-reset "18:30"`,照抄 Claude 显示的重置时间即可)/ `--week-reset "Ddd HH:mm"`(如 `--week-reset "Mon 09:00"`)锚定从 Claude 官方界面查到的真实值。会话重置时间过期、且本机近 5 小时无活动记录时(可能账户空闲,也可能正在其他设备使用),会话行会显示为"未知"而不是编造的倒计时。周重置是账号固定的每周时刻,与活动无关,本地无法推算,所以未配置 `--week-reset` 时周行同样显示为"未知",只按近 7 天用量给出当前周期用量的上界;这个固定时刻只需录入一次,不会像会话那样过期。在 `watch` 运行中按 `r` 可随时依次重新录入这两个时刻(回车跳过任意一个即可继续用本地估算)。如果两者都未配置且在交互式终端中运行,`watch` 会提示输入一次,并把结果保存到 `%LOCALAPPDATA%/aimon/limits-settings.json`(或对应系统的等效路径)供后续运行复用。
`watch` 的默认视图 `limits` 近似展示 Claude 官方账户界面中的 "Current Session"(滚动 5 小时窗口)和 "This Week" 用量面板,并附带 **Time Progress**(当前窗口已经过去的时间比例)与 **Token Progress**(当前窗口用量占预算的比例)两条进度条。由于真实的重置时间存储在 Anthropic 账号侧,本地无法读取,默认会根据本地会话记录的时间戳估算;也可以用 `--session-reset "HH:mm"`(如 `--session-reset "18:30"`,照抄 Claude 显示的重置时间即可)/ `--week-reset "Ddd HH:mm"`(如 `--week-reset "Mon 09:00"`)锚定从 Claude 官方界面查到的真实值。会话重置时间过期、且本机近 5 小时无活动记录时(可能账户空闲,也可能正在其他设备使用),会话行会显示为"未知"而不是编造的倒计时。周重置是账号固定的每周时刻,与活动无关,本地无法推算,所以未配置 `--week-reset` 时周行同样显示为"未知",只按近 7 天用量给出当前周期用量的上界;这个固定时刻只需录入一次,不会像会话那样过期。

Claude 官方界面本身也只显示用量**百分比**,从不显示背后的 token 上限,因此 Token Progress 走同样的逻辑:传入 `--session-token-progress <百分比>` / `--week-token-progress <百分比>`(如 `--session-token-progress 32`,照抄 Settings > Usage 或 Claude Code 里 `/usage` 显示的 "32%"),`watch` 会结合这个百分比与当前已统计到的 token 数反推出一个预算,之后就能持续实时对照这个预算刷新进度条,不用每次都重新问。

在 `watch` 运行中按 `r` 可随时重新录入这四个值——两个重置时刻和两个用量百分比(提示时直接回车会保留当前值或本地估算)。如果这四项中有任意一项未配置且在交互式终端中运行,`watch` 会一次性提示输入,并把结果保存到 `%LOCALAPPDATA%/aimon/limits-settings.json`(或对应系统的等效路径)供后续运行复用。

![watch --view limits](docs/images/watch-limits-screenshot.png)

### WPF 仪表盘(仅 Windows)

> **⚠️ 尚在开发中,暂不建议使用。** WPF 项目目前仍在积极开发,功能不完整,可能存在明显问题。请先使用 CLI(`aimon`)。

```
dotnet run --project src/AIUsageMonitor.WPF
```
Expand Down
Binary file added docs/images/watch-limits-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading