/ccam-analytics:session-reportfrom ccam-analytics
Generates detailed session reports from the Claude Code Agent Monitor, including per-model token usage, cost breakdown, tool invocations, agent hierarchy, compaction events, API errors, turn durations, and thinking block counts.
Ships in ccam-analytics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate a detailed session report from the Claude Code Agent Monitor.
The user provides: $ARGUMENTS
This may be a session ID, "latest", or a date range like "last 24 hours".
All data comes from the Agent Monitor API at http://localhost:4820:
| Endpoint | What it returns |
|---|---|
GET /api/sessions/{id} | Session with nested .agents[] and .events[] |
GET /api/sessions?limit=50 | Session list with agent_count, last_activity, and inline cost per session (bulk pricing applied server-side) |
GET /api/pricing/cost/{sessionId} | { total_cost, breakdown: [{ model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost, matched_rule }] } |
GET /api/events?session_id={id} | Event stream: each has event_type, tool_name, summary, data (JSON), created_at |
active / completed / error / abandonedclaude-sonnet-4-20250514)thinking_blocks count, turn_count, total_turn_duration_ms, usage_extras (service_tier, speed, inference_geo)input_tokens, output_tokens, cache_read_tokens, cache_write_tokens per model (baselines are pre-summed into these totals at the DB level)(tokens / 1,000,000) × rate_per_mtok for each of 4 token types, using longest-match pricing rulePreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, Notification, Compaction, APIError, TurnDurationInclude these columns: Model, Input, Output, Cache Read, Cache Write, and Total.
Show effective totals (current + baseline) since baselines preserve tokens lost during compaction. Calculate cache hit rate: cache_read / (cache_read + input) × 100.
From /api/pricing/cost/{id} — show each model's cost with the matched pricing rule. Note rates are per million tokens.
Render the agent tree (main → subagents, with nested children). For each agent: name, type, subagent_type, status, task (first 60 chars), duration.
Count PreToolUse events by tool_name. Flag tools that appear in error events. Note subagent spawns (tool_name = "Agent").
Compaction events (each = context was compressed)List any APIError events with type (quota, rate_limit, overloaded) and message.
Key lifecycle events: SessionStart → first tool → compactions → errors → Stop → SessionEnd. Include TurnDuration events.
Clean Markdown: executive summary line, structured tables, agent tree, numbered timeline. Bold key metrics.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
session-report, agent-monitor, token-usage, cost-analysis, claude-code
4 plugins ship this exact skill · first indexed Aug 25, 2026
6 skills in this plugin
/cache-efficiencyAnalyze prompt-cache effectiveness for Claude Code usage from the Agent Monitor dashboard — cache hit rate (total_cache_read / (total_cache_read + total_input)), cache_write vs cache_read reuse, cache-read vs cache-write spend, and the sessions with the poorest reuse. Pulls token totals from /api/analytics, per-session detail from /api/sessions, and dollar splits from /api/pricing/cost. Use when diagnosing cache spend or deciding whether prompt caching is paying off.
/cost-breakdownBreak down Claude Code costs using the Agent Monitor pricing engine. Shows per-model costs (input, output, cache_read, cache_write at $/Mtok rates), per-session costs, daily trends, and compaction baseline token recovery. Use when analyzing spending, comparing model costs, or planning budgets.
/model-mixBreak down Claude Code usage by model family (Opus / Sonnet / Haiku) from the Agent Monitor dashboard — each family's share of tokens, share of cost, and the spots where an expensive model is doing cheap work. Pulls per-model token and cost splits from /api/pricing/cost, current rates from /api/pricing, fleet token totals from /api/analytics, and per-session model assignment from /api/sessions. Use when deciding model routing or whether to downshift work to a cheaper tier.
/productivity-scoreCalculate a productivity score using actual Agent Monitor metrics — session completion rates, cache efficiency (cache_read vs input), compaction pressure (baseline tokens), turn velocity (turn_count / total_turn_duration_ms), tool success ratio (PreToolUse vs PostToolUse), and the workflow intelligence API's complexity and effectiveness scores.
/usage-trendsAnalyze 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.
npx claudepluginhub hoangsonww/claude-code-agent-monitor --plugin ccam-analyticsOther plugins' skills for the same job