big-spender 0.14.0 → 0.14.1
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 +1 -1
- package/dist/collector.mjs +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -369,7 +369,7 @@ about 15 to 20 percent less.
|
|
|
369
369
|
| Source | Files | Notes |
|
|
370
370
|
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
371
371
|
| Claude Code | `~/.claude/projects/**/*.jsonl`, `~/.config/claude/projects`, `$CLAUDE_CONFIG_DIR/projects` | `assistant` lines; de-duplicated by `message.id` + `requestId` (one API response is logged once per content block, and resumed sessions copy history). `<synthetic>` skipped; subagent logs included. Some Claude Code versions (2.1.293 to 2.1.310) log a partial output count on a message's first line and the final count on a later line; a later line that reports more output adds the difference. |
|
|
372
|
-
| Codex | `~/.codex/sessions/**/rollout-*.jsonl`, `$CODEX_HOME/sessions`
|
|
372
|
+
| Codex | `~/.codex/sessions/**/rollout-*.jsonl`, `~/.codex/archived_sessions`, `$CODEX_HOME/sessions`, `$CODEX_HOME/archived_sessions` | `event_msg` / `token_count` with `info.last_token_usage`; skipped when `total_token_usage` did not change. Model from the latest `turn_context`. `cached_input_tokens` is part of `input_tokens`; reasoning is part of `output_tokens`. |
|
|
373
373
|
| Cursor | Cursor's API, `DashboardService/GetFilteredUsageEvents`, with `BIG_SPENDER_CURSOR_API_KEY` | Events with token counts only. Cost is Cursor's `totalCents`. Events have no unique id and pages can overlap, so a time window with more than 1,000 events is split in half instead of paged. `cacheWriteTokens` count as 5-minute cache writes. Sessions are hashed `conversationId`s. Model names are lowercased, and anything outside `a-z 0-9 . _ : @ -` becomes `-`. |
|
|
374
374
|
| pi | `~/.pi/agent/sessions/**/*.jsonl`, `$PI_CODING_AGENT_DIR/sessions`, `$PI_CODING_AGENT_SESSION_DIR`, `$PI_AGENT_DIR` (comma-separated, as in ccusage) | Assistant `message` entries with `usage`; `input` excludes cached tokens, reasoning is part of `output`, and `cacheWrite` counts as 5-minute writes except its `cacheWrite1h` part. Calls with no tokens (aborted, failed before a retry) are skipped, and a call with only `totalTokens` counts it as output. A fork's file starts with a copy of its parent's calls up to the fork; those leading calls are skipped when the parent file has them. ccusage looks only at the parent's current branch, so it counts the copy again once the parent moves to another branch. A model id that is a file path (absolute, a `file://` or `host:/` URL, or ending in `.gguf` and similar) is reduced to its file name. `subagent-artifacts/` transcripts are skipped. Cost is LiteLLM's, not the cost pi stores. |
|
|
375
375
|
| Grok Build (experimental) | `~/.grok/sessions/**/updates.jsonl`, `$GROK_HOME/sessions` | **Experimental:** checked against ccusage on test fixtures built from its Grok parser tests, not yet against real Grok Build logs. `turn_completed` lines, one row per model in `usage.modelUsage` (the top-level usage under `summary.json`'s `current_model_id` when that map is missing). De-duplicated by `eventId` + model, also across sessions, since one event can be exported into several; a row without `eventId` by its full content within its file. `cachedReadTokens` and `cacheCreationTokens` are part of `inputTokens`; reasoning is part of `outputTokens`. Always the base rate: a turn sums several API requests, so its total cannot pick the long-context tier; a request of its own above 200K tokens is under-priced. A model id that is a file path is reduced to its file name. A turn cut off before it completes is never logged, so it is not counted. |
|
package/dist/collector.mjs
CHANGED
|
@@ -2478,8 +2478,11 @@ const SOURCES = {
|
|
|
2478
2478
|
priceKeys: litellmKeys('anthropic')
|
|
2479
2479
|
},
|
|
2480
2480
|
codex: {
|
|
2481
|
-
paths: [join(HOME, '.codex', 'sessions')],
|
|
2482
|
-
envPaths: () =>
|
|
2481
|
+
paths: [join(HOME, '.codex', 'sessions'), join(HOME, '.codex', 'archived_sessions')],
|
|
2482
|
+
envPaths: () => [
|
|
2483
|
+
...fromEnv('CODEX_HOME', 'sessions'),
|
|
2484
|
+
...fromEnv('CODEX_HOME', 'archived_sessions')
|
|
2485
|
+
],
|
|
2483
2486
|
read: jsonlReader((ctx, file, path) =>
|
|
2484
2487
|
codexLineHandler(
|
|
2485
2488
|
ctx.state,
|