OpenClaw Source
The openclaw adapter reads OpenClaw agent transcripts:
~/.openclaw/agents/**/*.jsonl- legacy homes:
~/.clawdbot/agents,~/.moltbot/agents,~/.moldbot/agents
llm-usage daily --source openclawllm-usage daily --openclaw-dir /path/to/.openclaw/agentsllm-usage daily --source-dir openclaw=/path/to/.openclaw/agentsParsing behavior
Section titled “Parsing behavior”- Reads transcript JSONL rows recursively in deterministic path order.
- Uses
sessionrows forsessionId, timestamp, andcwd. - Tracks provider/model changes as later transcript rows update runtime state.
- Emits only assistant messages with usage.
- Preserves explicit
usage.costvalues when present. - Reads pi-style usage (
input,output,cacheRead,cacheWrite), where input already excludes cache reads. For OpenAI Chat Completionsprompt_tokens, which include cached input, cache reads are subtracted from input. - Falls back to the
sessionrow timestamp when an assistant usage row has no timestamp of its own, and skips the row otherwise (never the file mtime, which moves as the session grows). - Ignores non-usage user/system/tool rows and OpenClaw delivery-mirror assistant rows.