--- title: Qwen Code description: How ClawMetry observes Qwen Code — where its data lives, the environment variables that move it, what cost data is real, and the traps in its store. eyebrow: Runtime reference --- # Qwen Code Qwen Code is a hard fork of Gemini CLI that rewrote the recorder, so it shares the lineage but not the format. Chat recording is opt-in, which is the first thing to check when a Qwen install shows no sessions. | | | |---|---| | **Runtime id** | `qwen_code` | | **Category** | Terminal coding agent | | **Vendor** | Alibaba | | **Tier** | Paid tier (Starter and up) | | **Upstream** | [github.com/QwenLM/qwen-code](https://github.com/QwenLM/qwen-code) | ## Where the data comes from ClawMetry reads these locations, in order, and never writes to any of them. - `~/.qwen/projects//chats/.jsonl` **Format.** One JSON record per line: a flat envelope (`uuid`, `parentUuid`, `sessionId`, `timestamp`, `type`, `model`) plus a nested `message` in Gemini `Content.parts` shape. ## Environment variables | Variable | Effect | |---|---| | `QWEN_HOME` | points AT the data dir (contrast with GEMINI_CLI_HOME) | See [Environment variables](/docs/config/environment/) for the variables that apply to every runtime. ## Tokens and cost **Tokens.** Real: `usageMetadata` carries prompt, candidates, thoughts, cached and total counts. **Cost.** Not recorded — the endpoint may be a free local Ollama — so cost is left unknown rather than fabricated. :::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. ::: ## Things worth knowing - Chat recording only happens with `--chat-recording` or the `general.chatRecording` setting. Without it there is nothing on disk to read, and that is a Qwen setting, not a ClawMetry bug. - `` is the working directory with `/` replaced by `-`, not a real hash. - The on-disk assistant role is Gemini's `"model"` string; ClawMetry normalises it to `assistant`. ## Verify it is being read ```bash # Is this runtime detected, and would this install unlock it? clawmetry runtimes --json | jq '.runtimes[] | select(.id=="qwen_code")' # Why is it locked, if it is? clawmetry runtimes --why qwen_code # 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.