Data & storage
Exports#
The store is yours. Several ways to get data out of it, in rough order of how often people want them.
The query API#
The most flexible route, and the one to reach for first. Every shape returns JSON you can pipe.
# every session in a window, as newline-delimited JSON
curl -s localhost:8900/api/local/query -X POST \
-H 'content-type: application/json' \
-d '{"shape":"sessions","args":{"since":"2026-08-01T00:00:00Z","limit":2000}}' \
| jq -c '.rows[]' > sessions.ndjson
# per-day cost as CSV
curl -s localhost:8900/api/local/aggregates \
| jq -r '.rows[] | [.day, .total_tokens, .cost_usd] | @csv' > cost.csvSession and trace exports#
curl -s 'localhost:8900/api/export/traces' | jq
curl -s 'localhost:8900/api/export/events' | jqThe Conversations tab also exports an individual session — its transcript, tool timeline and cost breakdown — for sharing or archiving.
The reports browser#
Drop a Markdown file in ~/.clawmetry/reports/ and it becomes a page, with SQL
results rendered inline and a CSV download.
clawmetry reports
curl -s localhost:8900/api/reports | jq
curl -s localhost:8900/reports/<slug>/export.csvThis is the right answer for a recurring question that is not worth a dashboard tab. Write the query once, and it is a page with a CSV link forever.
Push to your observability stack#
Rather than pulling, push. ClawMetry can export its own metrics over OTLP:
export CLAWMETRY_OTEL_EXPORT_ENDPOINT=https://otlp.example.com/v1/metrics
export CLAWMETRY_OTEL_EXPORT_HEADERS='{"x-api-key":"…"}'
export CLAWMETRY_OTEL_EXPORT_INTERVAL=60curl -s localhost:8900/api/otel/export | jq
curl -s localhost:8900/api/otel-status | jqAgent cost and activity then sit next to the rest of your infrastructure telemetry, in whatever you already use. → OpenTelemetry
Tier: otel_export is a Pro feature.
SIEM export#
For security tooling, a stream shaped for a SIEM rather than a metrics backend.
| Variable | Effect |
|---|---|
CLAWMETRY_SIEM_HOST | Destination host |
Tier: siem_export is Enterprise.
Evidence pack#
A bundle assembled for regulatory review — the events, the integrity verification, the policy decisions and the attributions, packaged together.
curl -s localhost:8900/api/compliance/evidence-pack | jq
curl -s localhost:8900/api/compliance/status | jq
curl -s localhost:8900/api/compliance/article50/preview | jqTier: evidence_pack is Enterprise.
Copying the store itself#
For a full backup, copy the DuckDB file — but stop the daemon first, or you may capture an inconsistent state.
clawmetry sync --restart
cp ~/.clawmetry/local_store.duckdb ~/backups/clawmetry-$(date +%F).duckdbYou can then open it with any DuckDB client:
duckdb ~/backups/clawmetry-2026-09-05.duckdb -c "SELECT count(*) FROM events"Exports contain your transcripts
Session content includes whatever your agents read and wrote, which can include secrets that ended up in a tool result. Treat an export with the same care as the sessions themselves, and see Hardening for redaction options.
Before uninstalling#
clawmetry uninstall removes the store. Export anything you want to keep first
— the rollups in particular, since they hold long-term cost history that
survived your retention window.
curl -s localhost:8900/api/local/runtimes | jq '.rows' > runtime-history.json
curl -s localhost:8900/api/local/models | jq '.rows' > model-history.json
curl -s localhost:8900/api/local/aggregates | jq '.rows' > daily-history.json