Skip to main content

Run a local audit

npx @xerg/cli audit
By default, Xerg looks at:
  • OpenClaw: /tmp/openclaw/openclaw-*.log
  • OpenClaw: ~/.openclaw/agents/*/sessions/*.jsonl
  • Hermes: ~/.hermes/logs/agent.log* with gateway.log* fallback
  • Hermes: ~/.hermes/sessions/
Override either input explicitly:
npx @xerg/cli audit --runtime openclaw --log-file /path/to/openclaw.log
npx @xerg/cli audit --runtime openclaw --sessions-dir /path/to/sessions
npx @xerg/cli audit --runtime hermes --log-file ~/.hermes/logs/agent.log
npx @xerg/cli audit --runtime hermes --sessions-dir ~/.hermes/sessions
You can pass one, the other, or both. If only one supported local runtime is present, Xerg auto-selects it. If both OpenClaw and Hermes are present, pass --runtime explicitly.

Audit a Cursor usage CSV locally

npx @xerg/cli audit --cursor-usage-csv ~/Downloads/usage-events-2026-04-08.csv
This local-only path analyzes Cursor’s exported usage rows instead of agent session logs.
  • 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
  • agent-runtime findings like retry waste and loop waste are intentionally disabled for this source

Limit the audit window

npx @xerg/cli audit --since 24h
npx @xerg/cli audit --since 7d
npx @xerg/cli audit --since 30m
The CLI help and transport code support minute (m), hour (h), day (d), and week (w) suffixes.

Output modes

Default terminal report:
npx @xerg/cli audit
JSON summary plus recommendations:
npx @xerg/cli audit --json
Markdown report:
npx @xerg/cli audit --markdown > xerg-audit.md
You can use either --json or --markdown, but not both in the same command.

Local snapshot storage

Unless you pass --no-db, Xerg stores each audit locally in SQLite so later runs can use --compare and xerg push. Default database path:
PlatformDefault path
macOS~/Library/Application Support/xerg/xerg.db
Linux${XDG_DATA_HOME:-~/.local/share}/xerg/xerg.db
Windows%LOCALAPPDATA%\xerg\Data\xerg.db
Use a custom database path:
npx @xerg/cli audit --db /path/to/xerg.sqlite
Skip local persistence entirely:
npx @xerg/cli audit --no-db
If you skip persistence, --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
  • the first savings test to run next
Use findings and recommendations for the exact taxonomy and recommendation fields.