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 system heartbeat last
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 active runtime model, current context usage, and last-response tokens. Turn on/usage tokensfor per-reply token and cache details. Use/usage fullonly when you also want locally estimated cost; it can omit dollars when compatible pricing or usage metadata is unavailable./usage costsummarizes costs from local session logs—it is not a provider invoice. - 2
Separate entitlement from session burn
Runopenclaw status --usagefor provider-reported usage windows where the provider supports them. A low percentage remaining says the account window is constrained; it does not identify the prompt, tool, or automation that consumed it. 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 statusandopenclaw automations list. For a suspicious job, inspectopenclaw automations runs --id <job-id> --limit 20. Then checkopenclaw system heartbeat last. Unexpected cadence, repeated error runs, or a heartbeat sharing a large main session is a stronger lead than a single verbose reply. - 4
Inspect what is repeatedly entering context
Run/context detail. 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. Shared-session heartbeats may also inherit conversation history. Inspect cadence and run history; do not assume every wake has the same token cost.
- 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 by reading supported OpenClaw records and grouping token history by day and model. 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.
Reviewed official OpenClaw references
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.