ccost 0.3.0 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +9 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -46,7 +46,7 @@ ccost sl --chart 5h # rate limit chart
46
46
 
47
47
  | Flag | Description |
48
48
  |------|-------------|
49
- | `--per <dim>` | Group by: `day`, `hour`, `month`, `session`, `project`, `model`. Up to 2 for nested grouping. Default: `--per day --per model`. |
49
+ | `--per <dim>` | Group by: `day`, `hour`, `month`, `session`, `project`, `model`, `subagent`. Up to 2 for nested grouping. Default: `--per day --per model`. |
50
50
  | `--order <order>` | Sort: `asc` (default) or `desc`. |
51
51
 
52
52
  Two-level grouping creates parent-child rows, e.g. `--per day --per model` shows each day with per-model breakdowns.
@@ -268,6 +268,12 @@ ccost --per month --output csv --filename usage.csv
268
268
  # Two-level: project > model
269
269
  ccost --per project --per model --table full
270
270
 
271
+ # Subagent cost breakdown
272
+ ccost --per subagent --cost decimal
273
+
274
+ # Session > subagent: see subagent cost within each session
275
+ ccost --per session --per subagent
276
+
271
277
  # Copy JSON to clipboard
272
278
  ccost --copy json
273
279
 
@@ -342,7 +348,7 @@ struct LoadOptions {
342
348
  session: Option<String>,
343
349
  }
344
350
 
345
- enum GroupDimension { Day, Hour, Month, Session, Project, Model }
351
+ enum GroupDimension { Day, Hour, Month, Session, Project, Model, Subagent }
346
352
 
347
353
  struct GroupedData {
348
354
  label: String,
@@ -380,7 +386,7 @@ Reads JSONL conversation logs from Claude Code's local storage:
380
386
  - `~/.claude/projects/*/` (session files and `subagents/`)
381
387
  - `~/.config/claude/projects/*/` (alternate location)
382
388
 
383
- Both are scanned and deduplicated via symlink detection. Subagent transcripts are found in both the old (`<project>/subagents/`) and new (`<project>/<session-uuid>/subagents/`) directory structures.
389
+ Both are scanned and deduplicated via symlink detection. Subagent transcripts are found in both the old (`<project>/subagents/`) and new (`<project>/<session-uuid>/subagents/`) directory structures. Each record carries an `agent_id` (the subagent file stem, or empty for the main session), enabling `--per subagent` grouping.
384
390
 
385
391
  ### Deduplication
386
392
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccost",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Analyze Claude Code token usage and costs from local conversation logs and statusline data (Rust CLI & lib)",
5
5
  "repository": {
6
6
  "type": "git",