Skip to content

Kimi adapter does not read Kimi Code CLI usage data #1246

Description

@nathanAtHeadfwd

Hi,

The existing "kimi" command doesn't pick up usage from Kimi Code CLI (the Moonshot agent CLI). I looked into why and found two mismatches:

  1. Data directory: ccusage looks in "/.kimi", but Kimi Code CLI stores its sessions under "/.kimi-code".
  2. Wire format: ccusage expects a "StatusUpdate" message with snake_case "token_usage" fields, but Kimi Code CLI writes "usage.record" events with camelCase fields ("inputOther", "inputCacheRead", etc.) and millisecond timestamps.

The path layout is also deeper:

  • Old: "~/.kimi/sessions/group/session/wire.jsonl"
  • Kimi Code CLI: "~/.kimi-code/sessions/{workspace}/{session}/agents/{agent}/wire.jsonl"

I have a branch ready that fixes this and I have tested it against my own "~/.kimi-code" data. Happy to open a PR if you're interested.

Thanks for the great tool!

Activity

  1. pullfrog commented on Jun 10, 2026

    @pullfrog
    Contributor
  2. github-actions commented on Jun 10, 2026

    @github-actions
    Contributor

    This 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 replies lgtm, your future issues and PRs will stay open.

    See CONTRIBUTING.md.

  3. ryoppippi commented on Aug 31, 2026

    @ryoppippi
    Member

    Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.

    Audit result: maintainable candidate. The request fits the current ccusage scope and can be evaluated with repository-owned code or fixtures, without vendor credentials or platform-specific release infrastructure. It remains closed for now; reopen only after confirming current relevance and expected behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage:maintainableFits the repository's maintainable scope and needs review.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions