Run a local audit
- OpenClaw:
/tmp/openclaw/openclaw-*.log - OpenClaw:
~/.openclaw/agents/*/sessions/*.jsonl - Hermes:
~/.hermes/state.db(preferred, opened read-only) - Hermes observer:
~/.hermes/xerg/events/when the optional plugin is enabled - Legacy Hermes logs/transcripts only when no database exists
--state-db cannot be combined with legacy --log-file or --sessions-dir. The observer directory is optional. Exactly reconciled observer evidence may split a state aggregate into request calls, but it never adds tokens, requests, or spend.
Without an explicit runtime, --otlp-file remains an independent OpenClaw source and cannot be combined with transcripts, logs, another runtime, or remote inputs. The certified Hermes exception requires --runtime hermes and an auditable --state-db; see Hermes trace collection.
Install the optional content-free observer with hermes plugins install xergai/hermes-observer --enable. It writes only to the local ledger and never exports telemetry to Xerg Cloud.
Hermes state.db support covers schema 16 (Hermes v0.17), schema 20 model-usage rows, and schema 22 task-dimension rows (Hermes v0.19), plus future compatible schemas. Xerg mirrors Hermes’s positive-residual usage reconciliation, collapses compression continuations, and keeps branches and delegated sessions separate. A session overlapping --since is included in full because aggregate usage cannot be apportioned across the boundary.
If only one auto-detectable local runtime is present, Xerg auto-selects it. If OpenClaw and Hermes are both present, pass --runtime explicitly. Claude Code is never auto-selected — opt in with --runtime claude-code (next section).
Audit Claude Code sessions locally
~/.claude/projects/ — no hooks, no daemon, pure read. Subagent (sidechain) usage is included and grouped into the parent session.
- costs are estimated from token usage and local model pricing, including cache read/write tokens (subscription plans do not bill per token)
- models without a local pricing entry stay visible as
unpricedinstead of being silently zeroed - pass
--claude-code-dir /path/to/projectsif your transcripts live outside the default location
Audit a Cursor usage CSV locally
- usage CSV rows carry no retry, loop, or runtime structure and no true workflow traces
- agent-runtime findings like retry waste and loop waste are therefore intentionally disabled for this source; Cursor audits surface Cursor-specific findings (such as
cache-carryoverandmax-mode-concentration) only - Xerg estimates spend only for Cursor aliases that have an explicit local pricing map
- unmapped aliases stay visible in token and model breakdowns as
unpriced
xerg ingest --file payload.json instead — the full findings engine runs on that path.
Limit the audit window
m), hour (h), day (d), and week (w) suffixes.
Output modes
Default terminal report:--json or --markdown, but not both in the same command.
Local snapshot storage
Unless you pass--no-db, Xerg stores each audit locally in a JSON snapshot store so later runs can use --compare and xerg push.
Default snapshot path:
Use a custom snapshot path:
--compare will not work.
What the report contains
- total spend, observed spend, and estimated spend
- daily spend and confirmed waste series in UTC
- structural waste and structural waste rate
- savings opportunities
- top workflows and top models by spend
- high-confidence waste findings
- an Action queue with top
fix_now,test_next, andwatchitems - compare-aware validation guidance via
xerg audit --compare --push - a separate local Mechanical efficiency section for Hermes observer metrics and conservative findings; it has no dollar impact and never affects recommendations or CI gates
- separate local Tool activity and Workload economics sections for OpenClaw evidence; these neutral blocks never affect findings, recommendations, waste, or CI gates
- a count-only extraction note when some detected source files produced no included calls in the audit window (for example, files whose records all fall outside
--since, or files with no usage-bearing records). The note reports counts only — file paths never appear in the report or on the push wire. Runxerg doctor --runtime <runtime> --verboselocally to see which files.