Skip to main content
Xerg audits AI usage in dollars rather than tokens. It reads OpenClaw logs/transcripts or an independent sanitized trace capture, Hermes v0.17+ state.db, QM through a secure versioned PostgreSQL export, Claude Code transcripts, and Cursor usage CSV exports — or event payloads from any framework via xerg ingest — normalizes activity locally, and surfaces where spend is leaking. Xerg reports agent-runtime economics from the evidence each source exposes. Costs may be observed, locally estimated, or unpriced. They are not provider-invoice reconciliation, and Xerg does not currently ingest provider bills or convert runtime audits to FOCUS. See the FOCUS retirement note.
Local audits and --compare are free with no account. A Free hosted workspace (up to 2 members) saves the last 30 days of pushed audits with up to 100 stored snapshots per month. Ask Xerg, hosted MCP, Slack, and policies require a Pro or Enterprise workspace.
Working inside a coding agent? Install the Xerg skill with npx skills add xergai/skills and ask your agent to audit your spend. See skill bundle.

What Xerg does

  • Guides first-time local setup with xerg init.
  • Audits local OpenClaw or Hermes activity from default paths or explicit files.
  • Audits QM through a host-independent qm-snapshot/v1 adapter, strict direct-reader collection, or the certified Fly-contained one-shot exporter.
  • Optionally collects runtime-specific OpenClaw or certified Hermes traces over loopback, sanitizing before local persistence and never pushing automatically.
  • Audits local Claude Code session transcripts from ~/.claude/projects/.
  • Audits local Cursor usage CSV exports.
  • Audits any other framework through a versioned JSON event payload with xerg ingest.
  • Compares the current audit with the newest compatible cached snapshot.
  • Audits OpenClaw SSH and Railway targets from your local machine.
  • Exports human-readable, Markdown, and machine-readable JSON output.
  • Connects to a hosted workspace with browser-approved xerg activate, pushes summaries when you choose, and can fail CI when confirmed waste is above a threshold.
  • Tracks pushed audits, sources, trends, Optimizations, policies, and workspace API keys in the hosted dashboard.
  • Exposes hosted audit history, recommendations, sources, policies, and guarded write actions through hosted MCP.

What Xerg surfaces

Xerg separates monetary findings from informational signals:
  • Active monetary findings: retry-waste, tool-loop, and cache-thrash
  • Neutral signals: deep-loop-activity, context-outlier, context-growth, fixed-cadence-activity, premium-model-routine-label, cache-read-concentration, and max-mode-concentration
Findings require exact correlation and cost ownership. Signals report observed metrics plus optional associated spend that is explicitly not classified as waste; they never affect waste totals, recommendations, Optimizations, or CI gates. If a source does not expose the required evidence, the corresponding detector is marked unavailable rather than inferred.

Default data sources

By default, Xerg looks for:
  • OpenClaw gateway logs at /tmp/openclaw/openclaw-*.log
  • OpenClaw session transcripts at ~/.openclaw/agents/*/sessions/*.jsonl
  • Hermes state database at ~/.hermes/state.db (preferred and read-only)
  • optional Hermes observer ledger at ~/.hermes/xerg/events/; legacy logs/transcripts remain fallback inputs where present
  • Claude Code session transcripts at ~/.claude/projects/
  • Cursor usage CSV exports through --cursor-usage-csv
  • Event payloads from any framework through xerg ingest --file
  • QM only when selected explicitly with --runtime qm; init never probes a database or Fly app
If your data lives elsewhere, use --state-db for Hermes, --log-file / --sessions-dir for legacy sources, or --claude-code-dir for Claude Code. QM operators should start with secure QM setup, then use QM collection or Fly collection. For optional traces, see OpenClaw trace collection and Hermes trace collection. OpenClaw captures remain independent from transcript/log audits; Hermes captures only enrich an authoritative state.db.

Start here

  1. Install Xerg.
  2. Start with xerg init or run the quickstart.
  3. Keep the most useful commands nearby with the CLI cheat sheet.
  4. If the data lives elsewhere, start with doctor. Use remote audits for OpenClaw SSH and Railway targets.
  5. Learn the core model in waste taxonomy, metrics, and how it works.
  6. When you want hosted features, use hosted dashboard, activate and push, hosted MCP, and optimizations and policies.
  7. When you want local automation, use CI gates.

Hosted workspace features

With a free Xerg workspace, you can: Pro and Enterprise workspaces additionally get full pushed audit history, unlimited members, Ask Xerg, hosted MCP for Cursor, Claude Code, Codex, or another MCP client, Slack notifications, and policy drafts.

Current limits

  • Cost per outcome requires outcome signals (declared with xerg outcome, carried on ingest events, or derived from terminal call states); runs without a signal stay untracked. See metrics for details.
  • Neutral signals are informational patterns, not monetary findings or recommendations.
  • QM activity is complete only inside QM’s retained one-hour activity window; durable economics remain available outside it. openrouter/auto stays unpriced unless QM records an authoritative routed model and valid cost.
  • Xerg stores economic metadata and audit summaries locally. It does not store prompt or response content.