--- title: Kimi description: How ClawMetry observes Kimi — where its data lives, the environment variables that move it, what cost data is real, and the traps in its store. eyebrow: 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 id** | `kimi` | | **Category** | Terminal coding agent | | **Vendor** | Moonshot AI | | **Tier** | Paid tier (Starter and up) | | **Upstream** | [github.com/MoonshotAI/kimi-cli](https://github.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 - `/sessions///wire.jsonl` — the event log - `/sessions/…/context.jsonl, state.json, subagents//` - `/kimi.json` — work-dir registry; /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 | Variable | Effect | |---|---| | `KIMI_SHARE_DIR` | Kimi's own share-dir env | | `CLAWMETRY_KIMI_ROOTS` | extra share dirs to consider | See [Environment variables](/docs/config/environment/) 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. :::note 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](/docs/ops/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.