danielrigobertojs

AI Usage Exporter — AI skill for Claude Code

AI community

Prometheus exporter for local AI coding-agent usage — reads Claude Code, Codex and OpenCode logs from disk.

How to install AI Usage Exporter

This entry records only its repository, not the path inside it, so there is no exact command to give. Open danielrigobertojs/ai-usage-exporter and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What AI Usage Exporter does

Prometheus exporter for local AI coding-agent usage — reads Claude Code, Codex and OpenCode logs from disk. No login, no telemetry, no account.

Alternatives in AI

  • Token Monitor — Local-first desktop widget for tracking token usage, costs, and limits across 32+ AI coding tools—including Cl 1.8k ★
  • TokenTracker — Local-first AI token usage & cost tracker for 31 coding tools incl 1.4k ★
  • onWatch — Open-source Go CLI that tracks AI API quota usage across 7 providers (Synthetic, Z.ai, Anthropic, Codex, GitHu 397 ★

README

[Leer en español](README.es.md)

ai-usage-exporter

Go Prometheus exporter for local AI-agent usage (Claude Code, Codex CLI, OpenCode, and others): tokens, models, sessions, and cost read directly from each tool's local logs and exposed on an HTTP endpoint `/metrics`.

What it looks like

Every screenshot below is rendered from the synthetic data that ships in [`tools/demo-data`](tools/demo-data). No real host name, no real spend and no real log ever reaches these images, and [`tools/demo-data/capture`](tools/demo-data/capture/README.md) documents how to regenerate them.

![Grafana panel showing tokens and cost for the last hour, from synthetic demo data](docs/images/dashboard-live.png)

*Tokens and cost over the last hour: what you are spending right now.*

![Grafana time series splitting tokens per machine across two synthetic hosts](docs/images/dashboard-by-instance.png)

*Tokens per machine. The whole fleet in one panel.*

![Grafana bar chart breaking down cost by model](docs/images/dashboard-cost-by-model.png)

*Which model the money goes to.*

![Grafana bar chart splitting tokens into input, output and cache classes](docs/images/dashboard-token-classes.png)

*Input vs output vs cache. The cache share is the saving you rarely see.*

![Grafana table listing files, errors and availability per machine and provider](docs/images/dashboard-health.png)

*Exporter health: files, errors and availability per machine and provider.*

Project status

The binary scans registered providers and serves `/metrics`. It includes:

  • Go module layout (cmd/ai-usage-exporter, internal/...).
  • ADR-001 for scans and gauges, and ADR-002 for CGO-free builds.
  • The metrics contract, parallel provider scanning, the Prometheus collector, and the HTTP endpoints /metrics, /healthz, and /readyz.
  • Claude Code, Codex, and OpenCode providers.

Run the expor