--- title: OpenClaw description: How ClawMetry observes OpenClaw — where its data lives, the environment variables that move it, what cost data is real, and the traps in its store. eyebrow: Runtime reference --- # OpenClaw OpenClaw is the runtime ClawMetry grew up around, and it is the most completely observed. Sessions, chat channels, cron jobs, memory files, skills and the live gateway are all read directly, and the gateway WebSocket gives sub-second liveness that filesystem polling cannot. | | | |---|---| | **Runtime id** | `openclaw` | | **Category** | Personal agent gateway | | **Vendor** | OpenClaw | | **Tier** | Free in the OSS package | | **Upstream** | [github.com/openclaw/openclaw](https://github.com/openclaw/openclaw) | ## Where the data comes from ClawMetry reads these locations, in order, and never writes to any of them. - `~/.openclaw/agents/main/sessions/*.jsonl` — session transcripts - `~/.openclaw//*.jsonl` — one directory per chat adapter - `~/.openclaw/logs/` — rotating structured logs - `ws://127.0.0.1:18789` — gateway JSON-RPC, live events **Format.** Append-only JSONL per session in OpenClaw's v3 envelope, plus a live JSON-RPC WebSocket on port 18789. ## Environment variables | Variable | Effect | |---|---| | `OPENCLAW_HOME` | workspace root (auto-detected; default ~/.openclaw) | | `CLAWMETRY_OPENCLAW_DIR` | config directory override; also --openclaw-dir | | `OPENCLAW_GATEWAY_TOKEN` | gateway auth token for the live WebSocket | | `OPENCLAW_GATEWAY_URL` | gateway URL if it is not on the default port | | `OPENCLAW_SESSIONS_DIR` | session directory override | | `OPENCLAW_LOG_DIR` | log directory override | See [Environment variables](/docs/config/environment/) for the variables that apply to every runtime. ## Tokens and cost **Tokens.** Full split on disk (input, output, cache read, cache write). **Cost.** Derived at ingest from the token split and the model, using the multi-provider pricing table. :::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 Sub-agent runs are first-class sessions with a parent link, so a Task fan-out shows as a tree rather than one flat log. ## Things worth knowing - `parentId` on an OpenClaw v3 event is a *chain* pointer (the previous event), not a tree parent. Reading it as a tree produces nonsense topology. - Sessions spawned by OpenClaw that shell out to the Claude CLI are recorded under the OpenClaw session UUID. The standalone Claude Code adapter deliberately skips those ids so the same work is not counted twice. ## Verify it is being read ```bash # Is this runtime detected, and would this install unlock it? clawmetry runtimes --json | jq '.runtimes[] | select(.id=="openclaw")' # Why is it locked, if it is? clawmetry runtimes --why openclaw # 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.