@cc-status-line/cli 0.1.7 → 0.2.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.
Files changed (2) hide show
  1. package/README.md.full +35 -1
  2. package/package.json +5 -5
package/README.md.full CHANGED
@@ -181,6 +181,11 @@ Prints a colored cheat-sheet of every segment, every color, every glyph.
181
181
  | `{burn}` | `🔥 32.4k/min` | Session-average token rate |
182
182
  | `{skills}` | `skills: jira×3 wiki×1` | Skill calls, top 4 by count |
183
183
  | `{mcp}` | `mcp: github×2` | MCP-server calls, top 4 |
184
+ | `{cost_last}` | `last $0.012` | USD cost of the last turn (current model price) |
185
+ | `{cost_session}` | `sess $1.42` | Cumulative USD cost for the current session |
186
+ | `{cost_today}` | `today $4.18` | USD cost across all sessions today |
187
+ | `{cost_week}` | `7d $24.50` | USD cost over the last 7 days |
188
+ | `{cost}` | `last $0.012 · today $4.18` | Combo: `cost_last + cost_today` |
184
189
  | `{mode}` | `[detailed]` | Current mode label |
185
190
 
186
191
  ## Configuration
@@ -235,7 +240,36 @@ Two relevant Claude Code env vars (set in `~/.claude/settings.json` `env` block)
235
240
 
236
241
  cc-status reads `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` from the process env at render time, so the bar always matches Claude Code's actual compact behavior.
237
242
 
238
- ## Performance
243
+ ## Pricing & cost segments
244
+
245
+ The `cost*` segments compute USD by multiplying per-model token counts
246
+ against built-in Anthropic prices (Opus, Sonnet, Haiku, with the 1M
247
+ context tier doubling input/output when the model name contains
248
+ `[1m]` / `(1m)`). Override or extend the table in your config:
249
+
250
+ ```toml
251
+ [pricing.opus]
252
+ input = 12.00 # $/M tokens
253
+ output = 60.00
254
+
255
+ # Or pin an exact model id (substring match, case-insensitive)
256
+ [pricing."anthropic--claude-opus-latest"]
257
+ input = 13.00
258
+ output = 65.00
259
+ ```
260
+
261
+ `{cost_today}` and `{cost_week}` walk every transcript under
262
+ `~/.claude/projects/`, incrementally folded into a rollup at
263
+ `$XDG_CACHE_HOME/cc-status/rollup.json`. First scan touches every
264
+ file; subsequent renders only read newly-appended bytes.
265
+
266
+ > **Caveat**: today/7d cost relies on the model id Claude Code writes
267
+ > into the transcript (`message.model`), which is the canonical id
268
+ > like `claude-opus-4-7` without the `[1m]` suffix. If you run on a
269
+ > 1M-context tier, today/7d under-counts by ~50% unless you add a
270
+ > matching `[pricing.opus]` override that bakes the doubled price in.
271
+
272
+
239
273
 
240
274
  - **Render latency**: ~20 ms (mostly forking `git` for status). Well under Claude Code's 300 ms status-line timeout.
241
275
  - **Transcript parsing**: incremental — a per-session JSON cache stores the file offset and aggregated counters. Parsing 1 GB of transcript on the first run is the worst case; every subsequent render reads only newly-appended bytes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-status-line/cli",
3
- "version": "0.1.7",
3
+ "version": "0.2.0",
4
4
  "description": "Multi-line, mode-switchable status line for Claude Code (Rust binary, npm-distributed)",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -35,9 +35,9 @@
35
35
  "postinstall": "node postinstall.js || true"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@cc-status-line/darwin-arm64": "0.1.7",
39
- "@cc-status-line/linux-x64": "0.1.7",
40
- "@cc-status-line/linux-arm64": "0.1.7",
41
- "@cc-status-line/win32-x64": "0.1.7"
38
+ "@cc-status-line/darwin-arm64": "0.2.0",
39
+ "@cc-status-line/linux-x64": "0.2.0",
40
+ "@cc-status-line/linux-arm64": "0.2.0",
41
+ "@cc-status-line/win32-x64": "0.2.0"
42
42
  }
43
43
  }