You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.en.md
+18-15Lines changed: 18 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ If Codex isn't installed or the directory doesn't exist, that part of the UI hid
72
72
73
73
- macOS
74
74
- Python 3.13
75
-
- Claude Code installed and signed in (Codex is optional)
75
+
- Claude Code or Codex has been used at least once so local usage data exists
76
76
77
77
## Quick start
78
78
@@ -104,11 +104,13 @@ Go to the [GitHub Releases page](https://github.com/aqua5230/usage/releases/late
104
104
⚠️ Because this app is not signed with an Apple Developer certificate, **macOS Gatekeeper will block the first launch**.
105
105
To open it: find `usage.app` in Finder → right-click → Open → confirm Open. After that, double-clicking works normally.
106
106
107
-
### First launch: install the hook
107
+
### First launch: set up the status line
108
108
109
-
The first time you open usage, if Claude Code has never been wired up yet, the popover will detect the missing status file and **show an extra "Install hook now" button at the bottom**. Click it once — it installs the hook for you. Then **fully quit Claude Code (Cmd+Q) and re-open it**, click "Refresh now" in usage, and the numbers will appear.
109
+
The first time you open usage, if you have already used Codex, the Codex card usually reads `~/.codex/sessions`and shows data directly. If you use Claude Code, the popover may show a **"Set Up Status Line"** button when app-side setup is needed. If you run from source and want to add Codex status-line fields, run the command below to configure detected agents.
110
110
111
-
If the button doesn't show, usage is already reading data (e.g. you previously installed the third-party tool [stormzhang/token-tracker](https://github.com/stormzhang/token-tracker) and its status file works as a fallback) — nothing else to do.
111
+
Restart the relevant tool afterward: restart Codex once; if Claude Code was configured too, fully quit Claude Code (Cmd+Q) and re-open it.
112
+
113
+
If the button does not show, usage can already read data or there is no Claude Code setup action for the app to perform.
112
114
113
115
> **Fallback: install via curl**
114
116
> If the in-app button doesn't work or you prefer the command line, run the following in Terminal (download first, inspect, then run):
@@ -119,7 +121,7 @@ If the button doesn't show, usage is already reading data (e.g. you previously i
119
121
> bash /tmp/usage-install.sh
120
122
>```
121
123
122
-
After the hook is installed and Claude Code is restarted, the bottom of the Claude Code window will show a statusLine like this — **5h / 7d quota bars, context usage, session duration, current model — all on one line**. Percentages share the bar color (yellow / green / red), so the warning level reads at a glance:
124
+
After the Claude Code hook is configured and Claude Code is restarted, the bottom of the Claude Code window will show a statusLine like this — **5h / 7d quota bars, context usage, session duration, current model — all on one line**. Percentages share the bar color (yellow / green / red), so the warning level reads at a glance:
This creates an isolated Python environment (`.venv`) for the project, activates it, and installs usage plus its dependencies into it.
148
150
149
-
## First install (wire up the Claude Code hook — source mode only)
151
+
## Set up detected agents (source mode)
150
152
151
-
> Using the .app? Just click the "Install hook now" button in the popover on first launch instead — you don't need this section. The steps below are for developers running usage from source.
153
+
> Using the .app? Click the "Set Up Status Line" button in the popover on first launch instead. The steps below are for developers running usage from source.
152
154
153
-
This single commanddoes two things: copies the hook script into `~/.claude/`, and updates your Claude Code settings to point at it.
155
+
This command configures detected agents: Codex gets `tui.status_line` in `~/.codex/config.toml`; if Claude Code is present, usage also copies the hook script into `~/.claude/` and updates Claude Code settings to point at it.
154
156
155
157
```bash
156
158
source .venv/bin/activate
157
159
python3 main.py --setup
158
160
```
159
161
160
-
**Restart Claude Code once after running this**so it re-reads `~/.claude/settings.json` and refreshes its status line. That refresh is when usage data first lands on disk.
162
+
**Restart Codex once after running this**. If Claude Code was configured, restart Claude Code too so it re-reads `~/.claude/settings.json` and refreshes its status line.
161
163
162
164
What `--setup` does in detail:
163
165
164
-
- Copies `usage_statusline.py` to `~/.claude/usage-statusline.py`.
165
-
- Points `statusLine`in`~/.claude/settings.json` at that hook.
166
-
- If you already had a custom `statusLine`, it is backed up to `settings.usage.previousStatusLine` so nothing is overwritten.
166
+
- Configures `tui.status_line` in `~/.codex/config.toml` when Codex is detected.
167
+
- If Claude Code is present, copies `usage_statusline.py` to `~/.claude/usage-statusline.py`.
168
+
- If Claude Code is present, points `statusLine` in `~/.claude/settings.json` at that hook.
169
+
- If you already had a custom Claude Code `statusLine`, it is backed up to `settings.usage.previousStatusLine` so nothing is overwritten.
167
170
168
171
To uninstall:
169
172
170
173
```bash
171
174
python3 main.py --unsetup
172
175
```
173
176
174
-
`--unsetup` restores your original statusLine and removes the hook and `~/.claude/usage-status.json`.
177
+
`--unsetup` restores the original Codex `status_line` and Claude Code `statusLine`, then removes the Claude hook and `~/.claude/usage-status.json`.
175
178
176
179
## Run modes
177
180
@@ -298,7 +301,7 @@ python3 main.py --tui --mock
298
301
299
302
## Options
300
303
301
-
-`--setup` / `--unsetup` — install or remove the Claude Code statusLine hook.
304
+
- `--setup` / `--unsetup` — configure or restore detected agents (Codex `status_line`; Claude Code `statusLine` hook).
302
305
- `--tui` — force terminal TUI mode (no menu bar).
303
306
- `--interval N` — how often (seconds) the UI re-reads the status file. Minimum 30, default 60.
304
307
- `--mock` — use fake data; don't read any status file.
@@ -349,7 +352,7 @@ The "Fix" column distinguishes three kinds of users — find yours first:
349
352
350
353
| Symptom | Likely cause | Fix |
351
354
|---------|--------------|-----|
352
-
| Menu bar shows `--`|Hook not installed, or Claude Code hasn't refreshed yet |**.app users**: click the "Install hook now" button in the popover. **Source users**: run `python3 main.py --setup`. Either way, restart Claude Code once afterwards|
355
+
| Menu bar shows `--` | No Codex `rate_limits` yet, or the Claude Code hook has not refreshed | Run one Codex conversation first. For Claude Code integration, **.app users** click "Set Up Status Line"; **Source users** run `python3 main.py --setup` |
353
356
| Accidentally hit "Quit", paw icon disappeared from the menu bar | "Quit" fully terminates the usage process; you have to relaunch it | **.app users**: press `Cmd+Space` for Spotlight, type `usage`, hit Enter; or double-click `usage.app` from `/Applications`. **LaunchAgent users**: run `launchctl start com.lollapalooza.usage` in Terminal. **Source users**: run `python3 main.py` in Terminal again |
354
357
| Status says "N minutes stale" | Claude Code isn't running | Open Claude Code and let it run; it updates the file on its next status refresh |
355
358
| Codex section is empty |`~/.codex/sessions/` doesn't exist or has no `rate_limits` events yet | Run a Codex conversation to generate log entries |
第一次打開 usage,如果你還沒「對接」過 Claude Code,popover 會偵測到「找不到狀態檔」,**最下面會多出一顆「立即安裝 hook」按鈕**,按一下就會幫你裝好。然後**完全結束 Claude Code(Cmd+Q)再重新打開一次**,在 usage 視窗按「立即更新」,數字就會跑出來。
| menu bar 顯示 `--`|hook 還沒裝、或 Claude Code 還沒刷新 |**.app 使用者**:點彈出視窗內的「立即安裝 hook」按鈕;**原始碼使用者**:跑 `python3 main.py --setup`。裝完都要重開一次 Claude Code|
357
+
| menu bar 顯示 `--`|還沒有 Codex rate_limits,或 Claude Code hook 還沒刷新 |先用 Codex 跑一次對話;若要接 Claude Code,**.app 使用者**點「設定狀態列」,**原始碼使用者**跑 `python3 main.py --setup`|
0 commit comments