npx @xerg/cli@latest doctor is the fastest way to confirm that Xerg can see local OpenClaw, Hermes, or Claude Code data before you run an audit.
Examples use npx @xerg/cli@latest. If you installed the CLI globally, substitute xerg.
Local checks
- the default gateway pattern
- the default sessions pattern
- detected source files
- notes about what is missing
--verbose when you want progress messages on stderr while doctor is checking paths and transports. For local sources it also prints an extraction-coverage report: per source file, how many calls were extracted and which economic signals the parser found (tokens, observed cost, cache tokens, stop reasons, tool names, latency), plus any unpriced models. Detected files that produced zero included calls are listed too, with their full local paths and an explicit calls: 0 row — including total extraction failure, where a file parses but no record carries usage. Use it to spot silent extraction gaps before they show up as $0 spend. This per-file breakdown is local-only; audit reports and pushed payloads carry a count-only note instead.
Use explicit local paths when your data is not in the defaults:
--runtime openclaw or --runtime hermes so doctor checks the exact runtime you mean. Claude Code checks are always explicit via --runtime claude-code.
Hermes doctor opens state.db read-only and reports schema/read failures, observer installation, ledger freshness, malformed records, unmatched sessions, writer drop counts, and request-reconciliation readiness (full, partial, or none). The observer is optional; an observer ledger or Hermes trace capture by itself is not an auditable monetary source.
To inspect Claude Code session transcripts:
~/.claude/projects), the transcript files it found, and the exact audit command to run next.
To inspect a local Cursor usage export instead:
SSH checks
- SSH connectivity
- whether
rsyncexists locally and remotely - default remote paths
- optional custom remote paths when you pass
--remote-log-fileor--remote-sessions-dir
Railway checks
railway CLI context.
If railway link in this directory points at a database, sidecar, or another non-OpenClaw service, doctor can authenticate successfully but still report that the linked service is unreachable or has no OpenClaw data. Re-run railway link in the directory where you invoke Xerg and choose the OpenClaw app service.
Use explicit --project, --environment, and --service values when you want a deterministic Railway target instead of the service linked to the current directory.
You can also target a specific service:
- whether the
railwayCLI is installed - whether the
railwayCLI is authenticated - whether the target service is reachable
- default and alternate OpenClaw paths
- optional custom remote paths when you pass
--remote-log-fileor--remote-sessions-dir
/tmp/openclawfor gateway logs~/.openclaw/agentsfor session files/data/.clawdbot/agents/main/sessionsas an alternate session directory when the default one is empty
When doctor says no data
If doctor cannot find any local OpenClaw or Hermes data:- for Hermes v0.17+, verify
~/.hermes/state.dbexists or pass--state-db - for legacy Hermes or OpenClaw data, pass explicit paths with
--log-fileand--sessions-dir - run
npx @xerg/cli@latest doctor --runtime claude-codeif you use Claude Code; transcripts are created automatically under~/.claude/projects - run
npx @xerg/cli@latest doctor --remote user@hostto inspect an SSH target directly from your machine - run
npx @xerg/cli@latest doctor --railwayto inspect a linked Railway service - use
--project,--environment, and--servicewhen you want a deterministic Railway target instead of the service linked to the current directory - run
npx @xerg/cli@latest audit --remote user@hostornpx @xerg/cli@latest audit --railwaywhen the data lives on another machine or service; see remote audits for the full workflow - remote audits still pull telemetry to the machine where you run Xerg and analyze it locally