/Catalogue/Prompt/hoangsonww/hoangsonww-claude-code-agent-monitor-usage-trends

Origin: github

usage-trends

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.

by hoangsonww · updated 21h ago · imported from GitHub

Installs0+0/7d
Security score0/100
Retention 14d0%
GitHub stars1K

Skill logic

Execution graph
User message
Prompt rewrites behaviour
Response

SKILL.md

View on GitHub ↗

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

EndpointReturns
GET /api/analyticsComprehensive 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=200Full session records with timestamps and metadata

Analytics response schema (GET /api/analytics)

{
  "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

2. Token Volume Trends

From analytics tokens (baselines are pre-summed into totals at the DB level):

  • Total tokens: total_input, total_output, total_cache_read, total_cache_write
  • Cache efficiency over time: total_cache_read / (total_cache_read + total_input) — trending up = improving
  • Output intensity: total_output / total_input ratio — high = Claude is verbose

3. Tool Usage Ranking

From tool_usage (top 20 tools by event count):

  • Bar chart data (tool name → count)
  • Tool diversity: unique tools used
  • Subagent spawns: count of "Agent" tool uses (each = a subagent launched)

4. Model Distribution

From agent_types + per-session model field:

  • Which models are used most frequently
  • Subagent type distribution: main (null) vs task vs explore vs code-review

5. Session Health Distribution

From sessions_by_status:

  • Completion rate: completed / total × 100
  • Error rate: error / total × 100
  • Abandoned rate: abandoned / total × 100

6. Event Type Distribution

From event_types:

  • PreToolUse/PostToolUse ratio (should be ~1:1; gap = tools failing)
  • Compaction frequency relative to session count
  • APIError count (quota hits, rate limits, overloaded)

Output

Markdown with tables and ASCII trend indicators (▲▼→). Include period comparison when applicable.

Discussion

No comments yet — start the thread.

Sign in to join the discussion.

/More from hoangsonww/Claude-Code-Agent-Monitor

hoangsonww· 21h agoSandbox
config-audit

Prompts · TypeScript · v0.1.0

Run a full audit of the user's Claude Code configuration via the Agent Monitor Config Explorer API: counts per surface (user vs project), duplicate or overlapping skills and subagents, hooks that run shell commands, and which surfaces are read-only vs mutable. Reads /api/cc-config/overview, /skills, /agents, /commands, /hooks, and /settings. Use when reviewing your Claude Code setup for sprawl, duplication, or risk.

#ai-agents#claude-agents#claude-code

0 1K
hoangsonww· 21h agoSandbox
hook-inventory

Prompts · TypeScript · v0.1.0

Inventory hooks across the user, project, and project-local settings plus the ~/.claude/hooks scripts directory — read through the Agent Monitor Config Explorer API — and flag hooks that POST to the network or run arbitrary commands. Reads /api/cc-config/hooks and /api/cc-config/hook-scripts. Use when auditing hook safety.

#ai-agents#claude-agents#claude-code

0 1K
hoangsonww· 21h agoSandbox
mcp-audit

Prompts · TypeScript · v0.1.0

Audit the configured MCP servers (user + project scope) via the Agent Monitor Config Explorer API: transport (stdio vs http), command/args and env variable names, headers, and the source file each definition came from. Reads /api/cc-config/mcp. Use when reviewing MCP integrations for hygiene, duplication, or unexpected transports.

#ai-agents#claude-agents#claude-code

0 1K
hoangsonww· 21h agoSandbox
memory-review

Prompts · TypeScript · v0.1.0

Review the file-based memory store via the Agent Monitor Config Explorer API: the user and project CLAUDE.md plus per-project auto-memory files under ~/.claude/projects/<slug>/memory/*.md. Groups by project, shows the index (MEMORY.md) vs per-fact files, and flags stale or oversized facts. Reads /api/cc-config/memory and /api/cc-config/file?path=. Use when curating agent memory.

#ai-agents#claude-agents#claude-code

0 1K