Skip to content

Commit 813462d

Browse files
committed
docs(cline): explain session ID prefixes and default root discovery
Session reports show IDs such as task:<id> and cli:<id>, but the guide never explained the prefixes. Document that task: marks extension and legacy CLI tasks and cli: marks CLI session transcripts, so a task and a CLI session that share an ID stay separate rows. The adapter README and the guide's storage table read as if each platform searched only its own config directory. default_roots() checks every candidate on every platform and skips missing ones. Say so, and mention the %USERPROFILE%\AppData\Roaming fallback in the README.
1 parent f473e33 commit 813462d

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎docs/guide/cline/index.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ For the Cline editor extension, ccusage searches the standard `globalStorage` lo
2828
| Linux | `${XDG_CONFIG_HOME:-$HOME/.config}/<editor>/User/globalStorage/saoudrizwan.claude-dev` |
2929
| Windows | `%APPDATA%\<editor>\User\globalStorage\saoudrizwan.claude-dev` |
3030

31-
On Windows, if `%APPDATA%` is unset, ccusage uses `%USERPROFILE%\AppData\Roaming`.
31+
ccusage checks every location in this table on every operating system and skips the ones that do not exist. On Windows, if `%APPDATA%` is unset, ccusage uses `%USERPROFILE%\AppData\Roaming`.
3232

3333
Each extension task stores its messages at:
3434

@@ -67,6 +67,8 @@ To read both extension and CLI data from custom locations, include both roots in
6767
| `ccusage cline monthly` | Group usage by month | [Monthly Usage](/guide/monthly-reports) |
6868
| `ccusage cline session` | Group usage by Cline session | [Session Usage](/guide/session-reports) |
6969

70+
Session IDs carry a prefix for the format they came from: `task:<task-id>` for extension tasks and legacy CLI tasks, and `cli:<session-id>` for CLI session transcripts. The prefix keeps a task and a CLI session that share an ID as separate rows.
71+
7072
## Token and Cost Data
7173

7274
The extension parser counts only `say` records whose `say` value is `api_req_started`. Each needs its own `ts` timestamp, `modelInfo.modelId`, and flat JSON in `text` with `tokensIn`, `tokensOut`, `cacheReads`, and `cacheWrites`. The CLI parser counts assistant messages with their own timestamp, `modelInfo.id`, and `metrics` containing `inputTokens`, `outputTokens`, `cacheReadTokens`, and `cacheWriteTokens`. All four counters must be present as non-negative integer JSON numbers; an explicit `0` is valid, and missing fields are not filled with zero. Records with a missing, blank, or case-insensitive `unknown` model are skipped. A model is not inferred from `task_metadata` or conversation history.

‎rust/adapters/cline/README.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ and produces the standard daily, weekly, monthly, and session reports.
66
## Data sources
77

88
By default, the adapter searches `~/.cline` and Cline extension `globalStorage`
9-
directories for VS Code, VS Code Insiders, Cursor, Windsurf, and VSCodium. The
10-
extension storage locations follow each platform's normal config directory:
11-
`~/Library/Application Support` on macOS, `$XDG_CONFIG_HOME` (or `~/.config`)
12-
on Linux, and `%APPDATA%` on Windows.
9+
directories for VS Code, VS Code Insiders, Cursor, Windsurf, and VSCodium. For
10+
each editor it tries `~/Library/Application Support` (the macOS location),
11+
`$XDG_CONFIG_HOME` or `~/.config` (Linux), and `%APPDATA%` or
12+
`%USERPROFILE%\AppData\Roaming` (Windows). Every candidate is checked on every
13+
platform and roots that do not exist are skipped.
1314

1415
It recognizes these layouts under each data root:
1516

0 commit comments

Comments
 (0)