Repository navigation
Kimi Code 0.14 usage is not detected from ~/.kimi-code usage.record logs #1261
Description
Activity
github-actions commented
on Jun 11, 2026 on Jun 11, 2026 – with GitHub ActionsContributorMore actionsThis issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies
lgtmi, your future issues will stay open. If a maintainer replieslgtm, your future issues and PRs will stay open.See CONTRIBUTING.md.
@ryoppippi could this be reopened? Still reproducible on v20.0.14 (details below).
I'm still seeing this on ccusage 20.0.14.
I reproduced it in two separate environments, each with its own Kimi data directory:
- Windows: %USERPROFILE%.kimi-code
- WSL / Arch Linux: /home//.kimi-code
The behavior is the same in both places:
$ ccusage --version 20.0.14 # default (reads ~/.kimi, old kimi-cli format) — works $ ccusage kimi daily # OK, but only old data up to my migration date # pointing at the new Kimi Code dir — nothing $ KIMI_DATA_DIR=~/.kimi-code ccusage kimi daily No usage data found.On my WSL install,
~/.kimi-codecontains 137usage.recordturn events across 84wire.jsonlfiles. My Windows install has 1198 such events. In both cases,ccusagereports no usage data.From the files I have locally, Kimi Code appears to use a different wire format from the older kimi-cli format that the current adapter supports.
Current Kimi Code layout:
~/.kimi-code/sessions/<workspace>/session_<uuid>/agents/main/wire.jsonl ~/.kimi-code/sessions/<workspace>/session_<uuid>/agents/agent-0/wire.jsonlExample Kimi Code usage event:
{"type":"usage.record","model":"kimi-code/kimi-for-coding","usage":{"inputOther":3064,"output":76,"inputCacheRead":14848,"inputCacheCreation":0},"usageScope":"turn","time":1782113184943}
The older format currently parsed by the adapter looks like this:
{"timestamp": 1780046636.6985204, "message": {"type": "StatusUpdate", "payload": {"token_usage": {"input_other": 7190, "output": 200, "input_cache_read": 5888, "input_cache_creation": 0}}}}The main differences I noticed are:
- data directory changed from ~/.kimi to ~/.kimi-code
- path depth changed to include agents//wire.jsonl
- usage events are now type: "usage.record"
- usage fields changed from snake_case to camelCase
- timestamps are now milliseconds instead of seconds
- model names now use the kimi-code/ prefix
- usageScope: "turn" appears to be the per-turn delta
- usageScope: "session" appears to be cumulative and should probably be ignored to avoid double counting
Issues #1246 / #1247 / #1261 seem related, but they are closed, and I couldn't find a merged PR or commit on main that adds support for this newer Kimi Code format.
Would you be open to reopening this, or tracking Kimi Code support separately?I can share sample wire.jsonl data if that helps.send a pr plz! i don't personally use kimi code
send a pr plz! i don't personally use kimi code
@ryoppippi Hi, I've fixed this issue and here's the PR.#1362
Could you please review it and reply lgtm so the PR can go through?@ryoppippi I opened PR #1362 as requested for this Kimi Code fix, but it was auto-closed by the new-contributor gate. Validation (
just fmt,just typecheck,just test) passed. Could you please reopen or replylgtmif it looks OK?- added a commit that references this issue
on Jul 8, 2026 - added a commit that references this issue
on Aug 12, 2026 - addedtriage:resolvedResolved by a later change or current implementation.Resolved by a later change or current implementation.
on Aug 31, 2026 Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current
mainimplementation covers this request. This item is kept for history and does not need to be reopened.
ccusage currently reports no Kimi usage even though Kimi Code has local usage rows.
Environment:
20.0.110.14.0I tested the latest published native ccusage binary directly from npm:
Actual:
{"daily":[],"totals":{"cacheCreationTokens":0,"cacheReadTokens":0,"inputTokens":0,"outputTokens":0,"totalCost":-0.0,"totalTokens":0}}But Kimi Code stores usage here:
Those files contain usage rows like:
{"type":"usage.record","time":1781055528344,"usage":{"inputOther":4099,"inputCacheRead":6400,"inputCacheCreation":0,"output":101}}A sanitized local count found nonzero usage:
I also checked current upstream source/docs. The Kimi adapter still appears to target the legacy layout/schema:
~/.kimisessions/<group>/<session>/wire.jsonlStatusUpdatewithpayload.token_usage.input_other,output,input_cache_read, etc.Relevant lines:
This seems distinct from pricing-only Kimi fixes because usage is never loaded.
Prior reports with the same diagnosis were auto-closed by the new-contributor gate:
Expected:
ccusage should discover modern Kimi Code logs under
~/.kimi-code/sessions/*/*/agents/*/wire.jsonland parseusage.recordrows with camelCase usage fields.Likely fix:
~/.kimi-codeas a default Kimi data root, while preservingKIMI_DATA_DIRsessions/<workspace>/<session>/agents/<agent>/wire.jsonlusage.recordrows usingusage.inputOther,usage.inputCacheRead,usage.inputCacheCreation, andusage.outputtimeas milliseconds<session>path componentkimi-code/model prefix before pricing lookup