insights · hoangsonww — Claude Code command: usage analysis and installation
The insights command reads Agent Monitor data and reports three high-impact findings about Claude Code usage. Use it to spot activity shifts, cache patterns, or API errors.
MIT ★ 1,198 updated 2026-10-23
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-insights@claude-code-agent-monitor-pluginsWhat insights does
insights queries Agent Monitor’s local API for statistics and analytics. It compares the latest seven days with the seven before them, calculates the cache-read share, identifies frequently used tools and event types, and examines API errors and subagent activity.
The result ranks three findings by impact. Each includes a supporting value, why it matters, and a concrete next step. Currency appears in USD to four decimal places, while percentages use two. Agent Monitor must be reachable at http://localhost:4820; if the API cannot be reached, the command tells you to run npm start from the repository root. The dashboard is required for these metrics.
What it helps with
- compare Claude Code activity across two weeks
- calculate the cache-read share of token usage
- identify the most-used tool
- check API error share and subagent activity
Example prompts for the agent
- Analyze Agent Monitor data and report three key findings about Claude Code usage.
- Compare Claude Code activity over the latest seven days with the previous seven, then suggest an action.
- Check the API error share and cache usage using the dashboard data.
How to install insights
1Plugin marketplace
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor/plugin install ccam-insights@claude-code-agent-monitor-plugins2Manually: put the files in place
.claude/commands/insights.mdCall it with /insights. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/insights.mdCall it with /prompts:insights. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/insights.prompt.mdManually: put the files in place
.gemini/commands/insights.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about insights
How do I install insights in Claude Code?
Run /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor, then /plugin install ccam-insights@claude-code-agent-monitor-plugins. The command file is .claude/commands/insights.md.
What does the insights command do?
It analyzes Agent Monitor metrics and returns three prioritized findings about Claude Code usage. Each finding includes a supporting value, an explanation, and an action.
What needs to be running for insights to work?
Agent Monitor must be reachable at http://localhost:4820. If the API cannot be reached, the command directs you to run npm start from the repository root.
Source text
insights.md · MIT
--- description: Surface the top 3 data-backed insights about your Claude Code usage right now --- Produce the **top 3 insights** about Claude Code usage right now, each backed by real numbers from the Agent Monitor dashboard. 1. Fetch high-level state: - `curl -s http://localhost:4820/api/stats` → total_sessions, active_sessions, active_agents, total_events, events_today, agents_by_status, sessions_by_status. - `curl -s http://localhost:4820/api/analytics` → tokens (total_input/total_output/total_cache_read/total_cache_write), tool_usage (top 20), daily_events (365d), daily_sessions (365d), event_types, avg_events_per_session, total_subagents. 2. Derive signal, citing exact field values: - Cache hit rate = `total_cache_read / (total_cache_read + total_input)`. - Activity trend: compare the last 7 days of `daily_sessions`/`daily_events` against the prior 7. - Concentration: the single most-used tool and most-frequent `event_type`, with its share of the total. - Error pressure: `APIError` share of events; subagent fan-out via `total_subagents` and `avg_events_per_session`. 3. Pick the **3 most decision-relevant** findings (biggest cost lever, sharpest trend, or clearest anomaly). For each print: - A one-line headline with the supporting number. - Why it matters in one sentence. - One concrete action. Output rules: rank by impact (most important first); currency in USD to 4 decimals; rates as percentages to 2 decimals; use ▲/▼ for trend direction; cite only fields the API returned — never fabricate. If `curl` cannot reach `http://localhost:4820`, tell the user to start the dashboard with `npm start` from the repo root.
© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor
Similar slash commands
All slash commands for Agent setup: memory, context, orchestration →insights by other authors comes first.