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
All cost and usage sections support terminal hyperlinks using the [OSC 8 protocol](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). Click on the section text in a supported terminal to open the corresponding page:
| 🚦 Quota |`https://claude.ai/settings/usage` (always linked, even when showing `-`) |
63
+
| ⏱️ Time |`{webEndpoint}/users/{login}` (user profile) |
64
+
65
+
Session and Daily links require a configured ShellTime account (`userLogin` and `webEndpoint` from daemon). The Quota link is always active regardless of data availability.
53
66
54
67
### Git Status Indicator
55
68
@@ -69,6 +82,10 @@ The quota section displays your Anthropic API rate limit utilization across two
69
82
70
83
The percentage is clickable and links to your [Claude usage settings](https://claude.ai/settings/usage) page.
71
84
85
+
### Platform Note
86
+
87
+
On **Linux**, the quota section (`🚦`) is omitted entirely from the output — the statusline skips from Daily Cost to Time. On **macOS**, it is always shown (either with data or as `🚦 -`).
88
+
72
89
### Quota Color Coding
73
90
74
91
Color is based on the **maximum** utilization across both windows:
@@ -96,16 +113,22 @@ Color is based on the **maximum** utilization across both windows:
96
113
- Model name from `model.display_name`
97
114
- Session cost from `cost.total_cost_usd`
98
115
- Context usage from `context_window`
99
-
- Working directory from `working_directory`
100
-
3.**Git info** is fetched from the daemon (which caches it for performance)
101
-
4.**Daily cost** is fetched from ShellTime GraphQL API (cached for 5 minutes)
102
-
5.**Quota utilization** is fetched from Anthropic OAuth API by the daemon (cached for 10 minutes)
103
-
6.**Output** is a single formatted line with ANSI colors
116
+
- Working directory from `cwd`
117
+
- Session ID from `session_id` (used for session cost link)
118
+
- Workspace info from `workspace` (used for session-project mapping)
119
+
3.**Session-project mapping** is sent to the daemon as a fire-and-forget message (~1ms), associating the session ID with its project directory
120
+
4.**Git info** is fetched from the daemon (which caches it for performance)
121
+
5.**Daily cost** is fetched from ShellTime GraphQL API (cached for 5 minutes)
122
+
6.**Quota utilization** is fetched from Anthropic OAuth API by the daemon (cached for 10 minutes)
123
+
7.**Clickable links** are added to Session, Daily, Quota, and Time sections using OSC 8 terminal hyperlinks
124
+
8.**Output** is a single formatted line with ANSI colors
104
125
105
126
### JSON Input (from Claude Code)
106
127
107
128
```json
108
129
{
130
+
"hook_event_name": "StatusLine",
131
+
"session_id": "abc123-def456",
109
132
"model": {
110
133
"id": "claude-opus-4-1",
111
134
"display_name": "Opus"
@@ -125,7 +148,12 @@ Color is based on the **maximum** utilization across both windows:
125
148
"cache_read_input_tokens": 2000
126
149
}
127
150
},
128
-
"working_directory": "/home/user/projects/my-app"
151
+
"cwd": "/home/user/projects/my-app",
152
+
"version": "1.0.0",
153
+
"workspace": {
154
+
"current_dir": "/home/user/projects/my-app",
155
+
"project_dir": "/home/user/projects/my-app"
156
+
}
129
157
}
130
158
```
131
159
@@ -171,7 +199,7 @@ If no token is configured, the daily cost will show as `-`.
171
199
172
200
Requires **macOS** and the ShellTime daemon running. The daemon reads Claude Code's OAuth token from the macOS Keychain (service name: `Claude Code-credentials`) and queries the Anthropic usage API.
173
201
174
-
- **macOS only** - Keychain access is required to retrieve the OAuth token
202
+
- **macOS only** - Keychain access is required to retrieve the OAuth token; on Linux the quota section is omitted entirely
175
203
- **Daemon required** - quota data is fetched and cached by the daemon's background timer
176
204
- **No manual setup** - if you're logged into Claude Code on macOS, it works automatically
177
205
@@ -182,6 +210,8 @@ If quota data is unavailable, the section will show as `🚦 -`.
182
210
## Performance
183
211
184
212
- **Hard timeout:** 100ms for entire operation
213
+
- **Daemon request timeout:** 50ms for the daemon socket request (fast path)
214
+
- **Session mapping:** ~1ms fire-and-forget to daemon
185
215
- **API caching:** 5-minute TTL for daily cost, 10-minute TTL for quota utilization
186
216
- **Git info caching:** Daemon fetches git info in background timer loop, not on-demand
187
217
- **Quota caching:** Daemon fetches quota data asynchronously with rate-limit protection
@@ -212,7 +242,7 @@ If quota data is unavailable, the section will show as `🚦 -`.
212
242
213
243
### Quota shows `-`
214
244
215
-
1. Ensure you're on **macOS** - quota display is only available on macOS
245
+
1. Ensure you're on **macOS** - quota display is only available on macOS (omitted entirely on Linux)
216
246
2. Verify you're logged into Claude Code (the OAuth token is stored in macOS Keychain)
217
247
3. Ensure the daemon is running: `shelltime daemon status`
218
248
4. Quota data is cached for 10 minutes - it may take a moment after daemon start
@@ -221,6 +251,10 @@ If quota data is unavailable, the section will show as `🚦 -`.
221
251
222
252
Your terminal may not support ANSI colors. Check terminal settings or try a different terminal emulator.
223
253
254
+
### Links not clickable
255
+
256
+
Your terminal must support the [OSC 8 hyperlink protocol](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). Most modern terminals (iTerm2, WezTerm, Windows Terminal, GNOME Terminal 3.26+) support it. Older terminals or multiplexers (tmux, screen) may not.
0 commit comments