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 69fbca0
Browse filesBrowse the repository at this point in the historyBrowse files
fix(kimi): support Kimi Code new wire format (#1362)
Kimi Code (`~/.kimi-code`) emits a new `wire.jsonl` schema that the old
adapter could not parse, so its usage was silently dropped (#1261).
- Detect `~/.kimi-code` and the deeper layout
`sessions/<ws>/<session>/agents/<agent>/wire.jsonl` (5 path components)
alongside the legacy 3-component layout.
- Parse top-level `type == "usage.record"` lines: camelCase token fields
(`inputOther`, `inputCacheRead`, `inputCacheCreation`), `time` in
milliseconds, and `model` prefixed with `kimi-code/` (stripped for
pricing lookup). Skip cumulative `usageScope == "session"` records.
- Deserialize `time` leniently so a float- or string-encoded timestamp
degrades to the file-mtime fallback instead of dropping the whole line.
- Walk the correct number of parents in `kimi_root_from_wire_path` for the
deeper layout so config resolution looks at the right root.
- Keep full backward compatibility with the old StatusUpdate format.
- Update the Kimi guide and data-source docs for `~/.kimi-code`.
Fixes#1261
Co-authored-by: Claude Opus 4.8 <[email protected]>
The tool automatically detects available data and aggregates all supported coding CLIs by default.
94
94
Each source-specific environment variable can also contain comma-separated directories, which lets unified reports combine current profiles and archives.
Copy file name to clipboardExpand all lines: docs/guide/kimi/index.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ ccusage daily
22
22
23
23
## Data Location
24
24
25
-
The CLI reads Kimi wire JSONL files from `KIMI_DATA_DIR` (defaults to `~/.kimi`). `KIMI_DATA_DIR` can be one directory or a comma-separated list of directories.
25
+
The CLI reads Kimi wire JSONL files from `KIMI_DATA_DIR` (defaults to `~/.kimi` and `~/.kimi-code`). `KIMI_DATA_DIR` can be one directory or a comma-separated list of directories.
26
26
27
27
```sh
28
28
KIMI_DATA_DIR="$HOME/.kimi,/backup/kimi" ccusage kimi daily
@@ -32,6 +32,7 @@ Expected files are discovered under:
Only `StatusUpdate` messages with non-zero token usage are included.
53
+
Only `StatusUpdate` messages with non-zero token usage are included. Kimi Code logs instead emit `usage.record` lines; only turn-scoped records are counted, since session-scoped records are cumulative totals.
53
54
54
55
## Cost Calculation
55
56
@@ -64,5 +65,5 @@ Kimi rows do not store recorded USD cost, so ccusage estimates cost from token c
64
65
## Troubleshooting
65
66
66
67
::: details No Kimi usage data found
67
-
Ensure the data directory exists at `~/.kimi/sessions/`. Set `KIMI_DATA_DIR` if your Kimi data lives elsewhere or in multiple archive roots.
68
+
Ensure the data directory exists at `~/.kimi/sessions/` or `~/.kimi-code/sessions/`. Set `KIMI_DATA_DIR` if your Kimi data lives elsewhere or in multiple archive roots.
0 commit comments