Claude Usage Exporter — AI skill for Claude Code
Prometheus/OTEL exporter for Claude.ai session and weekly usage metrics, with adaptive polling.
How to install Claude Usage Exporter
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open CodeForBreakfast/claude-usage-exporter and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Usage Exporter does
Prometheus/OTEL exporter for Claude.ai session and weekly usage metrics, with adaptive polling.
Alternatives in AI
- Ccstatusline — by sirmalloc - A highly customizable status line formatter for Claude Code CLI that displays model info, git b 5.5k ★
- Claude Chat Exporter — Claude Chat Exporter is a JavaScript tool that allows you to export your conversations with Claude AI into a w 407 ★
- AI Chat Exporter — Export your ChatGPT, Claude, Copilot, Gemini and Grok chat, using Tampermonkey on chrome, firefox, and other s 141 ★
README
claude-usage-exporter
Prometheus and OpenTelemetry exporter for Claude.ai session and weekly usage metrics. Polls the Claude.ai usage API for each configured account and exposes utilization percentages and reset timestamps as metrics.
Inspired by [claude-multi-account-usage](https://github.com/erkantaylan/claude-multi-account-usage).
How it works
The exporter reads account credentials from `accounts.yaml`, then polls the Claude.ai usage API for each account on independent goroutines. Results are exposed as OpenTelemetry metrics via a Prometheus `/metrics` endpoint (and optionally pushed over OTLP).
Adaptive polling
Poll frequency adjusts automatically based on activity:
| State | Behaviour |
|---|---|
| Active | Polls every activeInterval (default 30 s) whenever usage values change between polls |
| Idle back-off | After idleThreshold (default 3) consecutive unchanged polls, the interval doubles on each poll up to idleInterval (default 5 m) |
| Reset burst | When a usage window reset is less than resetBurstWindow (default 2 m) away, the interval snaps back to activeInterval regardless of idle state |
Any change in the session or weekly utilization value immediately resets the interval to `activeInterval`.
Metrics
All metrics carry an `account` label (the account name from your config) and an `org_id` label (the organization ID). The `org_id` is the join key between these metrics and Claude Code OTEL metrics, which emit `organization.id` as a resource attribute — enabling correlation of which CC host is consuming which account's quota.
| Metric | Type | Unit | Description |
|---|---|---|---|
claude_usage_session_utilization_percent |
Gauge | % | 5-hour session window utilization (0–100) |
claude_usage_weekly_utilization_percent |
Gauge | % | 7-day wee |
Related Skills
Agent Observability Stack
Self-hostable observability for LLM agents + a Linux host (Intel iGPU/NPU + NVIDIA RTX 3090 eGPU aware): Prome
AI Usage Exporter
Prometheus exporter for local AI coding-agent usage — reads Claude Code, Codex and OpenCode logs from disk. No
Turbotokens
Fast token usage reports and live telemetry for 18 AI coding agents. Native Rust CLI with budget alerts, Prome
Agent Deep Research
Deep research (CLI and agent skill) via the Gemini Interactions API. Automatic RAG grounding from local files
Openclaw Self Healing
32+ 4-tier autonomous crash recovery for Claude Code and any service — 64% auto-resolved, LLM-agnostic (Claude
Octoroute
Smart HTTP router for local LLMs (Ollama, LM Studio, llama.cpp). Rule-based + LLM-powered routing, health chec
Related Agents
Collector Privacy Reviewer
Collector の scrub 設定・パイプライン・ダッシュボード・recording rule の変更を、プライバシー境界が後退していないかという観点だけでレビューする。terraform/config/otel-
Observability Engineer
OpenTelemetry, distributed tracing, structured logging, metrics specialist — Grafana, Datadog, Prometheus
Platform SRE
Cluster operations and incidents - Kubernetes, kubectl, metrics/logs/dashboards (Prometheus, Grafana and the l