From plugin-insights
Analyze how well Claude Code plugins perform across sessions. Use when: "plugin insights", "plugin performance", "how are my plugins doing", "plugin analysis", "plugin report", "which plugins work well". Generates an HTML report from JSONL session transcripts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/plugin-insights:plugin-insightsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Arguments received: $ARGUMENTS
Arguments received: $ARGUMENTS
Before ANY other action, extract from the arguments above:
If a plugin filter is present, set PLUGIN_FILTER to that word and use it in ALL subsequent phases. If no arguments or empty: PLUGIN_FILTER = none, scan all plugins.
Copy this entire checklist into your response and fill in the values. Then check off each phase as you complete it.
PLUGIN_FILTER = <extracted filter or "none">
DAYS = <extracted days or "7">
Progress:
- [ ] Phase 1: Discovery and pre-filtering
- [ ] Phase 2: Parse sessions
- [ ] Phase 3: Quality review
- [ ] Phase 4: Aggregate
- [ ] Phase 5: Write HTML report
You MUST print this checklist as your first output. You CANNOT call any tool, run any command, or proceed to Phase 1 until this checklist is printed with PLUGIN_FILTER and DAYS filled in.
After completing each phase, reprint the checklist with the completed phase checked off ([x]). This makes skipping visible.
~/.claude/plugin-insights/report-<name>-<YYYY-MM-DD-HHmm>.html. Never write to the current working directory.| Thought | Reality |
|---|---|
| "No plugin filter given" | Check the REQUIRED OUTPUT block. If PLUGIN_FILTER is not "none", use it. |
| "I'll filter later during aggregation" | Pre-filtering in Phase 1 saves 80% of token costs. Do it now. |
| "Let me start finding files first" | STOP. Print the REQUIRED OUTPUT block first. |
| "I'll scan everything and filter later" | NO. Pre-filter is MANDATORY when PLUGIN_FILTER is set. |
| "Only 3 invocations, skip quality review" | NO. Phase 3 is mandatory regardless of count (Iron Law 8). |
| "I'll use the default model" | NO. Explicitly set model: "sonnet" on every agent spawn (Iron Law 7). |
| "I'll write the report to the current directory" | NO. Always ~/.claude/plugin-insights/ (Iron Law 9). |
Verify you printed the REQUIRED OUTPUT block. If not, go back and print it now.
If PLUGIN_FILTER is set, validate it:
subagent_type or command-name patterns.subagent_type values).List all JSONL session files modified within the DAYS range:
find ~/.claude/projects -name "*.jsonl" -maxdepth 2 -mtime -DAYS ! -path "*/subagents/*"
MANDATORY pre-filter (if PLUGIN_FILTER is set): Use the Grep tool (NOT bash grep) on each session file. Copy-paste this exact pattern:
Grep(pattern: "subagent_type.*PLUGIN_FILTER:", path: "<file>", output_mode: "count")
Also check for command-name:
Grep(pattern: "command-name.*PLUGIN_FILTER:", path: "<file>", output_mode: "count")
Only files where either grep returns >= 1 match go to parsers. Discard all others.
Print: "Found N sessions total, M contain PLUGIN_FILTER activity. Sending M to parsers in B batches..."
If PLUGIN_FILTER is "none": skip pre-filtering, send all sessions to parsers.
Group the filtered files into batches of 15.
Spawn pi-session-parser agents. MUST use model: "sonnet" explicitly.
Agent(
subagent_type: "plugin-insights:pi-session-parser",
model: "sonnet",
prompt: "Parse these JSONL files for plugin activity.\n\nFiles:\n<file-list>\n\nOnly extract data for plugin: PLUGIN_FILTER"
)
If PLUGIN_FILTER is "none", omit the "Only extract data for plugin" line.
This phase is NOT optional. Even with 1 invocation, run the quality reviewer.
Collect all invocation_details from parser results. Sort by timestamp (most recent first).
Determine sample size:
Spawn a single pi-quality-reviewer agent. MUST use model: "sonnet" explicitly:
Agent(
subagent_type: "plugin-insights:pi-quality-reviewer",
model: "sonnet",
prompt: "Review these plugin invocations for content quality.\n\nInvocations:\n<json-invocation-details>"
)
The quality reviewer receives per invocation:
It returns: relevance score (0-3), depth score (0-3), actionability score (0-3), what was missing, what was done well, and an overall verdict per invocation.
Compute per-plugin aggregates from parser data:
Derive correction and completion scores from behavioral data:
Compute quality aggregates from reviewer data:
Mark sessions from projects whose path contains the plugin name as "dev sessions". Report separately.
Generate improvement suggestions per the threshold rules:
Build the aggregated data as a JSON object with this exact structure:
{
"metadata": {
"version": "0.3.1",
"generated_date": "YYYY-MM-DD",
"date_range": "YYYY-MM-DD to YYYY-MM-DD",
"days": 7,
"plugin_filter": "review",
"total_sessions_scanned": 113,
"sessions_with_activity": 5
},
"plugins": {
"<name>": {
"invocations": 10,
"sessions": 5,
"projects": 3,
"error_rate": 0.0,
"tokens": { "input": 50000, "output": 12000 },
"behavioral": {
"retry_rate": 0.1,
"avg_continuation": 5.2,
"post_error_rate": 0.0,
"avg_correction_score": 0.4,
"avg_completion_score": 1.8
},
"quality": {
"avg_relevance": 2.5,
"avg_depth": 2.3,
"avg_actionability": 2.1
},
"agent_types": ["type-a", "type-b"],
"trend_weeks": [{"week": "W10", "count": 3}, {"week": "W11", "count": 7}],
"projects_list": [{"name": "...", "sessions": 2, "invocations": 5, "is_dev": false}],
"quality_reviews": [...],
"strengths": ["..."],
"improvements": ["..."],
"suggestions": ["..."]
}
}
}
Pass this JSON (as a string) to the report-writer in Phase 5.
Do NOT write the HTML report yourself.
Output file path: ~/.claude/plugin-insights/report-<PLUGIN_FILTER>-<YYYY-MM-DD-HHmm>.html
(or report-all-... if no filter). Create directory with Bash(mkdir -p ~/.claude/plugin-insights).
Resolve the template path: ${CLAUDE_SKILL_DIR}/report-template.html (absolute path).
Spawn the report-writer agent:
Agent(
subagent_type: "plugin-insights:pi-report-writer",
model: "sonnet",
prompt: "Write the plugin insights HTML report.\n\nTemplate file: <ABSOLUTE-PATH-TO-TEMPLATE>\nOutput file: <ABSOLUTE-OUTPUT-PATH>\n\nData:\n<JSON-STRING-FROM-PHASE-4>"
)
The prompt MUST contain:
After Phase 2, check for plugin-specific metric files:
~/.claude/deep-research/metrics.jsonlIf found, read and merge into aggregate data.
npx claudepluginhub phyr97/phyr97-marketplace --plugin plugin-insightsGenerates aggregate reports with trends and Mermaid visualizations across Claude Code sessions. Use for reviewing activity patterns, retrospective summaries, and collaboration insights.
Generates an in-chat session report from the active or named transcript — every tool call, sub-agent delegation, and file edit, with diagnostics for missed parallelism, redundant work, and over-serialization.
Generates usage analytics dashboard from Claude Code sessions with epistemic protocol coverage metrics, friction analysis, growth timelines, and improvement recommendations.