# Usage Trends

Analyze Claude Code usage trends over time using the Agent Monitor's analytics API, ...

- Repository: https://github.com/hoangsonww/Claude-Code-Agent-Monitor (1136 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill usage-trends -g -a claude-code -y`
Codex: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill usage-trends -g -a codex -y`
Cursor: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill usage-trends -g -a cursor -y`
Gemini CLI: `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill usage-trends -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor`

## Description

Analyze Claude Code usage trends over time using the Agent Monitor's analytics API, daily session counts, daily event counts, token volumes by type, model distribution, tool usage rankings, and agent/event type distributions across 365-day retention windows.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Usage Trends

Analyze usage patterns and trends from the Agent Monitor analytics data.

## Input

The user provides: **$ARGUMENTS**

Options: "last 7 days", "last 30 days", "last quarter", "peak hours", "tool trends", "model usage".

## Data Sources

| Endpoint | Returns |
|----------|---------|
| `GET /api/analytics` | Comprehensive analytics object (see schema below) |
| `GET /api/stats` | `{ total_sessions, active_sessions, active_agents, total_agents, total_events, events_today, ws_connections, agents_by_status, sessions_by_status }` |
| `GET /api/sessions?limit=200` | Full session records with timestamps and metadata |

### Analytics response schema (`GET /api/analytics`)

```json
{
  "overview": { "total_sessions", "active_sessions", "active_agents", "total_agents", "total_events" },
  "tokens": {
    "total_input": N, "total_output": N,
    "total_cache_read": N, "total_cache_write": N
  },
  "tool_usage": [{ "tool_name": "...", "count": N }],  // top 20
  "daily_events": [{ "date": "YYYY-MM-DD", "count": N }],  // 365 days
  "daily_sessions": [{ "date": "YYYY-MM-DD", "count": N }],  // 365 days
  "agent_types": [{ "subagent_type": "task"|"explore"|null, "count": N }],
  "event_types": [{ "event_type": "PreToolUse"|"PostToolUse"|..., "count": N }],
  "avg_events_per_session": N,
  "total_subagents": N,
  "sessions_by_status": { "active": N, "completed": N, "error": N, "abandoned": N },
  "agents_by_status": { "working": N, "completed": N, "error": N, ... }
}
```

## Trend Analyses to Produce

### 1. Daily Activity Trend
Plot `daily_sessions` and `daily_events` for the requested period. Compute:
- **Average sessions/day** and **events/day**
- Week-over-week delta (%)
- Peak day and quietest day

The rest: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/blob/HEAD/plugins/ccam-analytics/skills/usage-trends/SKILL.md
