CClawMetryDocs

Runtime reference

Kimi#

Kimi CLI and its successor Kimi Code CLI share a product line and a format but use different share directories. ClawMetry reads both and reports one runtime.

Runtime idkimi
CategoryTerminal coding agent
VendorMoonshot AI
TierPaid tier (Starter and up)
Upstreamgithub.com/MoonshotAI/kimi-cli

Where the data comes from#

ClawMetry reads these locations, in order, and never writes to any of them.

  • $KIMI_SHARE_DIR or ~/.kimi — Kimi CLI
  • ~/.kimi-code — Kimi Code CLI
  • <share>/sessions/<md5(work_dir)>/<session-uuid>/wire.jsonl — the event log
  • <share>/sessions/…/context.jsonl, state.json, subagents/<id>/
  • <share>/kimi.json — work-dir registry; <share>/config.toml — models

Format. wire.jsonl is one record per line, optionally preceded by a protocol-version header. Envelopes include TurnBegin, ContentPart, ToolCall, ToolResult and StatusUpdate.

Environment variables#

VariableEffect
KIMI_SHARE_DIRKimi's own share-dir env
CLAWMETRY_KIMI_ROOTSextra share dirs to consider

See Environment variables for the variables that apply to every runtime.

Tokens and cost#

Tokens. Real: StatusUpdate carries the full cache split per step, plus context-window occupancy.

Cost. Derived — but note the model honesty caveat below.

Why this section exists

Runtimes differ enormously in what they persist. Rather than showing a plausible number everywhere, ClawMetry reports what the store actually contains and marks the rest unknown. A cost of $0.00 and a cost of unknown mean different things, and the dashboard keeps them different.

Sub-agents and delegation#

Each sub-agent has its own directory with meta, context and wire logs.

Things worth knowing#

  • Kimi persists a complete token breakdown but not the model id — no wire record carries it. The model is resolved from config.toml, which is the model configured now, so such sessions are marked cost_status="estimated" with modelSource="config". No pricing match means cost is unknown, never a fabricated zero.
  • The session directory's parent is md5(work_dir), which is why project attribution comes from hashing each registered work dir in kimi.json rather than trying to invert a hash.

Verify it is being read#

bash
# Is this runtime detected, and would this install unlock it?
clawmetry runtimes --json | jq '.runtimes[] | select(.id=="kimi")'

# Why is it locked, if it is?
clawmetry runtimes --why kimi

# Any sessions ingested yet?
curl -s 'http://localhost:8900/api/local/sessions?limit=5' \
  | jq '.rows[] | {session_id, agent_id, events, cost_usd}'

If detection succeeds but no sessions appear, work through Troubleshooting — the usual causes are a relocated data directory (set the override above), a session limit that is hiding older runs, or a runtime that simply has not written anything yet.

Cookie preferences