Diagnose before you optimize
First decide whether the burn is scheduled, contextual, or loop-driven.
A long answer is visible. The expensive causes usually are not: the prompt may be replaying a large context, an automation may be waking in the background, or a tool failure may be provoking multiple model calls. Capture a baseline before editing configuration so you can prove which change helped.
/status
/usage tokens
/usage cost
/context detail
openclaw status --usage
openclaw automations list
openclaw automations runs <job-id> --limit 20
A five-step diagnostic flow
Use OpenClaw's own counters for the live session and provider window. Use local history for the longer before-and-after view. Those answer related—but different—questions.
- 1
Freeze a trustworthy baseline
In the affected chat, run/statusto record the session model, context usage, and the last reply's input and output tokens and estimated cost. It also shows the current provider's usage or quota where available. Turn on/usage tokensfor a per-reply footer with token and cache details./usage fulladds model, context, and cost; it can omit dollars when compatible pricing or usage metadata is unavailable. The footer setting is saved per session, and/usage offturns it off./usage costprints a local cost summary aggregated from OpenClaw's session logs. It is not a provider invoice. - 2
Separate entitlement from session burn
Runopenclaw status --usage. It prints each provider's usage windows as “X% left”, read directly from that provider's usage endpoint and cached for 60 seconds. The docs list Anthropic, OpenAI (including ChatGPT/Codex OAuth), GitHub Copilot, OpenRouter, xAI, DeepSeek, MiniMax, z.ai, and a few others. A low percentage says the account window is constrained. It doesn't tell you which prompt, tool, or automation used it up. Keep the provider's billing or plan dashboard as the final authority for charges and exact quota behavior. - 3
Check background wakes before touching prompts
Runopenclaw automations list(add--allto include disabled jobs). For a suspicious job, inspectopenclaw automations runs <job-id> --limit 20.cronstill works as an alias forautomations. Heartbeats are now ordinary automation jobs: a fresh setup creates one “Proactive check” job that runs every 30 minutes unless the provider sets another cadence, andopenclaw doctor --fixmigrates old heartbeat monitors into jobs.openclaw system heartbeat laststill shows the last compatibility heartbeat event. An unexpected cadence, repeated error runs, or a recurring job sharing a large main session is a stronger lead than a single verbose reply. - 4
Inspect what is repeatedly entering context
Run/context detail. It breaks the context down by file, tool schema, skill, and system prompt, and shows how many transcript messages could be compacted. Look for conversation history, large workspace bootstrap files, memory excerpts, attachments, and bulky tool outputs. OpenClaw counts system instructions, history, tools, results, attachments, summaries, and provider wrappers toward the context window. Context is not the same as stored memory: only the material injected into a run contributes to that run. - 5
Run one controlled A/B measurement
Pick a representative task. Record its input, cache-read, cache-write, and output totals. Change one suspected cause—job cadence, context isolation, tool-output size, retry cap, or route—then run an equivalent task once. If several variables change, the result is not diagnostic.
Match the symptom to the next check
Start with the shape of the increase. It is more useful than guessing from a monthly total.
Why OpenClaw token usage can run away
- Heartbeat or automation cadence
- A short interval can create many model runs even when chat is quiet. The default “Proactive check” job alone runs every 30 minutes, which is 48 runs a day. A job that shares a session may also carry its conversation history. Inspect cadence and run history, and don't assume every wake costs the same.
- Oversized context
- Long conversation history, bootstrap files, skill metadata, attachments, and prior tool results can make a tiny follow-up expensive because the input is resent to the model.
- Repeated tool output
- Large logs, minified bundles, recursive listings, or full API payloads can enter the transcript and be carried into later calls. Fix the query boundary at the tool, not only the prose summary afterward.
- Memory and workspace injection
- Always-loaded workspace files consume input every run. Ordinary daily memory files can remain on demand, but configured bootstrap or startup context should be reviewed when the initial prompt is unexpectedly large.
- Retries and tool loops
- One user request can trigger multiple model calls. Transient automation failures may retry with backoff; an agent can also repeat a tool when its stop condition is unclear. Provider totals may therefore exceed the latest visible context snapshot.
- Model routing changes
- Different routes have different tokenization, context budgets, output behavior, and prices. Confirm the runtime model shown by
/status; the configured default alone is not enough evidence.
Measure the fix, not the feeling
Compare equivalent work over a bounded period. The useful number is the change in recorded tokens, while keeping quality and task completion visible beside it.
Baseline
Same task class, time window, model, and quality bar
One change
Cadence, context, tool boundary, retries, or route
Retest
Compare deltas and confirm the task still succeeds
For diagnosis, also preserve the components: input, cache read, cache write, and output. Do not treat cached tokens as necessarily billable at the input rate, and do not infer a provider invoice from an API-equivalent local estimate.
Safe remediation checklist
Pause or disable only the confirmed recurring job; preserve its definition so you can restore it safely.
Give recurring work a narrow prompt, explicit completion condition, and maximum attempts or elapsed time.
Use isolated, light-context heartbeat sessions where continuity is unnecessary; a shared long session resends more history.
Replace unbounded file reads and log dumps with filtered, paginated, or summarized results.
Keep bootstrap and always-injected instructions concise; load detailed memory and reference material on demand.
Compact a long session or begin a fresh one between unrelated tasks, after recording the state you actually need.
Route repetitive monitoring to an adequate smaller model, then validate quality before making it the default.
Re-run the same representative task and compare token deltas—not just elapsed time or the final answer length.
Use whoburnedmore for the longer comparison
OpenClaw's native views are the right place for live session context, per-response usage, local cost summaries, and supported provider windows. whoburnedmore complements them with a token history grouped by day and model. Its bundled ccusage reader reads OpenClaw's current per-agent SQLite store (~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite) and the archived JSONL transcripts next to it, along with legacy .clawdbot and .moltbot folders. That makes it practical to compare the days before and after a workflow change or to notice that a route changed.
Standard workflow
npx whoburnedmoreThe standard command starts sign-in and submits daily aggregate rows to your profile. It does not submit prompts, code, or file names. Use this path only when you want the profile and comparison experience.
Local workflow
npx whoburnedmore --local--local builds a self-contained local dashboard without automatic sign-in or aggregate submission. In an interactive terminal, decline the optional publish offer to keep the run local. This is the privacy-preserving choice for a private baseline and before-and-after daily/model comparison.
Neither mode identifies the semantic reason a particular prompt was expensive. Correlate the daily/model change with OpenClaw's session, context, automation, and heartbeat evidence above. For the basic collection workflow, see the separate OpenClaw token usage guide.
Limits of this diagnosis
OpenClaw's token and cost views depend on the metadata returned by the active runtime and the pricing configured for that model. Estimated costs can be missing or differ from the provider's final bill. Provider usage windows describe entitlement or quota state, not which local task caused the consumption.
Token totals from a provider or transcript can include cached input and multiple model calls inside a tool loop, so they may exceed the latest live context snapshot. A day-level whoburnedmore aggregate helps locate a spike but cannot prove whether it came from a heartbeat, memory injection, a tool result, or a retry without OpenClaw-side evidence.
Official OpenClaw references (checked November 8, 2026)
Sources
- OpenClaw usage tracking documentation
Official explanation of OpenClaw token usage, context, and cost visibility.
- whoburnedmore CLI source
Canonical CLI commands and export behavior; use --local when no aggregate upload is wanted.