@owloops/claude-powerline 1.4.4 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,6 +52,8 @@
52
52
 
53
53
  - **Vim-style powerline** with proper arrows and segments
54
54
  - **Real-time session tracking** with costs and tokens
55
+ - **Billing window tracking** with 5-hour block usage
56
+ - **Daily usage monitoring** with budget alerts
55
57
  - **Performance metrics** with response times and burn rates
56
58
  - **Context monitoring** showing tokens used and auto-compact threshold
57
59
  - **Git integration** with branch, status, ahead/behind counts
@@ -144,7 +146,7 @@ Options are specified by command line flags. Overall configuration can also use
144
146
  ### Default Configuration
145
147
 
146
148
  ```bash
147
- # Shows directory, git, model, session usage (tokens), context info
149
+ # Shows directory, git, model, session usage (tokens), block usage, context info
148
150
  # Uses dark theme, minimal style
149
151
  claude-powerline
150
152
  ```
@@ -209,6 +211,8 @@ Configuration priority (top overrides bottom):
209
211
  "git": { "enabled": true, "showSha": true },
210
212
  "model": { "enabled": true },
211
213
  "session": { "enabled": true, "type": "tokens" },
214
+ "block": { "enabled": true, "type": "cost" },
215
+ "today": { "enabled": true, "type": "cost" },
212
216
  "context": { "enabled": true },
213
217
  "tmux": { "enabled": true },
214
218
  "metrics": {
@@ -232,6 +236,8 @@ Configuration priority (top overrides bottom):
232
236
  - **git**: Branch, status (clean/dirty), ahead/behind counts, SHA (optional)
233
237
  - **model**: Current Claude model being used
234
238
  - **session**: Token usage and costs for current session
239
+ - **block**: Usage within current 5-hour billing window
240
+ - **today**: Total daily usage with budget monitoring
235
241
  - **context**: Context window usage and auto-compact threshold
236
242
  - **tmux**: Tmux session name and window info (when in tmux)
237
243
  - **metrics**: Performance analytics (response time, session duration, message count, burn rates)
@@ -261,6 +267,69 @@ The metrics segment displays performance analytics from your Claude sessions:
261
267
 
262
268
  ![Metrics Segment Example](images/claude-powerline-metrics.png)
263
269
 
270
+ #### Usage Segments Configuration
271
+
272
+ The powerline includes three complementary usage segments:
273
+
274
+ ```json
275
+ {
276
+ "segments": {
277
+ "session": { "enabled": true, "type": "tokens" },
278
+ "block": { "enabled": true, "type": "cost" },
279
+ "today": { "enabled": true, "type": "cost" }
280
+ },
281
+ "budget": {
282
+ "session": { "amount": 10.0, "warningThreshold": 80 },
283
+ "today": { "amount": 25.0, "warningThreshold": 80 }
284
+ }
285
+ }
286
+ ```
287
+
288
+ **Segment Types:**
289
+
290
+ - **session**: Real-time usage for current Claude conversation
291
+ - **block**: Usage within current 5-hour billing window (Claude's rate limit period)
292
+ - **today**: Total daily usage with budget monitoring
293
+
294
+ **Display Options:**
295
+
296
+ **Session & Today segments:**
297
+ - `cost`: Show dollar amounts (`$0.05`)
298
+ - `tokens`: Show token counts (`1.2K tokens`)
299
+ - `both`: Show both (`$0.05 (1.2K)`)
300
+ - `breakdown`: Show token breakdown (`1.2Kin + 0.8Kout + 1.5Kcached`)
301
+
302
+ **Block segment** (always shows time remaining):
303
+ - `cost`: Show cost + time (`$0.05 (2h 30m left)`)
304
+ - `tokens`: Show tokens + time (`1.2K tokens (2h 30m left)`)
305
+
306
+ **Budget Configuration:**
307
+
308
+ ```json
309
+ "budget": {
310
+ "session": {
311
+ "amount": 10.0,
312
+ "warningThreshold": 80
313
+ },
314
+ "today": {
315
+ "amount": 25.0,
316
+ "warningThreshold": 80
317
+ }
318
+ }
319
+ ```
320
+
321
+ **Budget Indicators:**
322
+
323
+ - `25%` Normal (under 50%)
324
+ - `+75%` Moderate (50-79%)
325
+ - `!85%` Warning (80%+)
326
+
327
+ **Why Use Different Segments?**
328
+
329
+ - **session**: Track spending per conversation
330
+ - **block**: Monitor rate limits with time remaining (Claude throttles after 5-hour usage peaks)
331
+ - **today**: Stay within daily budgets
332
+
264
333
  ### Multi-line Layout (Optional)
265
334
 
266
335
  To prevent segment cutoff, configure multiple lines:
@@ -279,6 +348,8 @@ To prevent segment cutoff, configure multiple lines:
279
348
  {
280
349
  "segments": {
281
350
  "session": { "enabled": true, "type": "tokens" },
351
+ "block": { "enabled": true, "type": "cost" },
352
+ "today": { "enabled": true, "type": "cost" },
282
353
  "context": { "enabled": true },
283
354
  "tmux": { "enabled": false },
284
355
  "metrics": { "enabled": true }
@@ -305,6 +376,8 @@ To customize colors, copy dark or light theme colors from `src/themes/` in the r
305
376
  "git": { "bg": "#0066cc", "fg": "#ffffff" },
306
377
  "model": { "bg": "#9900cc", "fg": "#ffffff" },
307
378
  "session": { "bg": "#cc0099", "fg": "#ffffff" },
379
+ "block": { "bg": "#404040", "fg": "#cccccc" },
380
+ "today": { "bg": "#303030", "fg": "#dddddd" },
308
381
  "context": { "bg": "#4a5568", "fg": "#ffffff" },
309
382
  "tmux": { "bg": "#228b22", "fg": "#ffffff" },
310
383
  "metrics": { "bg": "#374151", "fg": "#ffffff" }