Cc Metrics — Development skill for Claude Code
A Grafana dashboard for Claude Code otel metrics (dockerized).
How to install Cc Metrics
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open alonw0/cc-metrics and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Cc Metrics does
A Grafana dashboard for Claude Code otel metrics (dockerized).
Alternatives in Development
- HTML Report — /html-report - Generate Application Tracker Dashboard 36.6k ★
- Triage PRs — Classify all open PRs by module, review state, scope, and architectural impact — produces a prioritized triage 12.6k ★
- Metrics Dashboard — Define product metrics dashboard with sources and alert thresholds 7.8k ★
README
Claude Code Metrics Dashboard
A comprehensive monitoring stack for tracking Claude Code usage metrics, costs, and performance using OpenTelemetry, Prometheus, and Grafana.
Based on the [Sealos blog post](https://sealos.io/blog/claude-code-metrics).
Features
- Real-time Metrics Tracking: Monitor Claude Code sessions, token usage, costs, commits, and more
- Comprehensive Dashboard: 20+ panels showing key metrics, efficiency gauges, trends, and distributions
- Cost Analysis: Track costs by model, session, and time period
- Cache Efficiency Monitoring: Visualize prompt caching effectiveness
- Productivity Insights: Measure CLI vs user active time ratios
- Auto-provisioning: Dashboard and datasources automatically configured on startup
Architecture
Claude Code
↓ (OTLP HTTP/gRPC - metrics + logs)
OpenTelemetry Collector (:4318/:4317)
├─→ Prometheus metrics (:8889)
│ ↓
│ Prometheus (:9090)
└─→ JSON logs (file)
↓
Promtail
↓
Loki (:3100)
↓ (PromQL + LogQL queries)
Grafana (:3000)
↓ (Dashboard visualization)
Your Browser
Metrics Tracked
- Sessions: Total Claude Code session starts
- Tokens: Usage by type (input, output, cache_read, cache_creation) and model
- Costs: Estimated USD costs with per-model breakdown
- Code Changes: Lines added/removed from accepted edits
- Git Activity: Commits and pull requests created
- Edit Decisions: Accept/reject choices on code suggestions
- Active Time: User input time vs CLI processing time
- Prompt Length: Average character count of user prompts (via Loki logs)
Prerequisites
- Docker and Docker Compose
- Claude Code CLI
Quick Start
1. Clone or Download This Repository
cd cc-metrics
2. Set Up Data Directories
make setup
Or manually:
mkdir -p data/prometheus data/grafana data/loki data/otel-logs
chmod
Related Skills
Aid Dashboard
Generate a quality dashboard report with metrics and visualizations
Swe Dashboard
Open a local browser dashboard of all .worklogs work items (metrics, cost, tokens).
Kuma:Studio
📊 Kuma Studio — Web dashboard for gotchas, flows, workspace matrix, and metrics
Grafana Cloud Agento11y Demo
Grafana Cloud Agent Observability (agento11y) demo environment
DarkFactory
Reusable "dark factory" prompt for agentic coding harnesses (Claude Code, Codex, Pi): from a vision.md to a te
Claude Code Otel
A comprehensive observability solution for monitoring Claude Code usage, performance, and costs.
Related Agents
Collector Privacy Reviewer
Collector の scrub 設定・パイプライン・ダッシュボード・recording rule の変更を、プライバシー境界が後退していないかという観点だけでレビューする。terraform/config/otel-
Observability Engineer
OpenTelemetry, distributed tracing, structured logging, metrics specialist — Grafana, Datadog, Prometheus
Otel Metric
Investigate and visualize OpenTelemetry metrics in Berserk — discover metrics, determine the right visualizati