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
{{ message }}
Repository navigation
Commit de43952
Browse filesBrowse the repository at this point in the historyBrowse files
fix(claude): show model breakdowns for session --id (#2057)
* docs(skills): credit issue reporters and reply after merging
Squash merges of #2050, #2051 and #2034 left out the reporters whose issues
drove the fixes, and #2004 and #1987 got no reply after the contributor pinged.
The create-pr skill now covers both steps at merge time, so they are no longer
left to memory.
* fix(claude): show model breakdowns for session --id
`ccusage claude session --id <ID>` ignored `--breakdown`, and its JSON
had no `modelBreakdowns`. The lookup path summed cost and tokens by
hand instead of building the `UsageSummary` that the session list
builds with `SessionAccumulator`, so it never had per-model data and
never reached the shared table renderer that draws breakdown rows.
Build the looked-up session through the same `SessionAccumulator` and
render the table with the shared `print_usage_table`, matching how
`codex session --id` reuses its session table. `--breakdown` now adds
per-model rows, and the JSON keeps its existing fields while adding
`modelsUsed` and `modelBreakdowns` (including `storedCost` and
`missingPricing` where they apply). The text summary with a separate
"Total Entries" line is replaced by the standard session table.
Codex already honors `--breakdown` for `--id` and the top-level
`ccusage session --id` routes to this Claude path, so no other agent
needed a change.
Co-authored-by: fdarian <[email protected]>
* docs(session): document model breakdowns for claude session --id
Describe the table and JSON shape of `ccusage claude session --id` now
that it shares the session table and emits `modelBreakdowns`, and note
that its breakdown entries mark unpriced models.
* Revert "docs(skills): credit issue reporters and reply after merging"
This reverts commit 3a33754.
---------
Co-authored-by: fdarian <[email protected]>
Detection follows the [cost mode](/guide/cost-modes): an entry counts as unpriced only when ccusage had to calculate its cost from tokens and found no price. In `display` mode, or in `auto` mode for an entry that carries its own stored cost, nothing is looked up, so nothing is reported. A model can therefore appear in `unpricedModels` and still show a positive cost when some of its entries carried stored costs. An absent key means no unpriced usage was detected under the selected mode, not that every price is current.
60
60
61
-
Covered: `daily`, `weekly`, `monthly`, and `session` reports for every agent, including `--instances`, `--sections`, and `--by-agent`. Focused `codex` reports set `missingPricing` on the affected entries of each period's `models` map. Not covered: `blocks` and `session --id`, which have no `totals` object.
61
+
Covered: `daily`, `weekly`, `monthly`, and `session` reports for every agent, including `--instances`, `--sections`, and `--by-agent`. Focused `codex` reports set `missingPricing` on the affected entries of each period's `models` map. `blocks` and `session --id`have no `totals` object; Claude's `session --id` still marks unpriced entries of its `modelBreakdowns`.
62
62
63
63
Update ccusage, or run without `--offline`, once the pricing source lists the model.
The table shows the same columns as `ccusage claude session`, restricted to that one session, and `--breakdown` adds a row per model. Claude's JSON output keeps `sessionId`, `totalCost`, `totalTokens`, and the per-request `entries`, and also carries the session's `modelsUsed` and per-model `modelBreakdowns`.
52
+
48
53
### Session ID Format
49
54
50
55
For Claude Code, session IDs are the actual filenames (without `.jsonl` extension) stored in Claude data directories. They typically look like:
0 commit comments