Skill Overview
Count and display the usage of installed skills within a specified time period, including:
- Number of invocations per skill
- Usage frequency ranking
- Total usage count
- Time trend analysis
Usage Flow
- Select the statistics time period
- Scan the list of installed skills
- Analyze conversation history records
- Display the statistics results in a beautiful table format
Available Time Periods
| Option | Description |
|---|---|
| Today | Count usage from 00:00 to now |
| Past 7 days | Count usage over the past week |
| Past 30 days | Count usage over the past month |
| Past 90 days | Count usage over the past three months |
| All | Count all historical records |
Output Format
The statistics results are displayed in the form of a Markdown table + visualized bar chart:
📊 技能使用统计报告 (过去 7 天)
═══════════════════════════════════════
排名 | 技能名称 | 调用次数 | 使用频率
─────┼────────────────┼──────────┼──────────
1 │ auto-skills │ 42 │ ████████░░ 80%
2 │ idea-to-post │ 28 │ ██████░░░░ 60%
3 │ humanizer-zh │ 15 │ ███░░░░░░░ 30%
─────┼────────────────┼──────────┼──────────
│ 总计 │ 85 │
Implementation Steps
Step 1: Select the time period
Use the AskUserQuestion tool to let the user select the statistics time period.
Step 2: Scan installed skills
List all skills under the ~/.claude/skills/ directory.
Step 3: Analyze history records
Parse the following files:
~/.claude/history.jsonl(global history)~/.claude/projects/*/session.jsonl(project sessions)
Find records matching the /skill-name pattern.
Step 4: Statistics and display
Calculate the usage count of each skill and display them in descending order.
Data Notes
- Skill identification: Identify skill invocations by matching the
displayfield in history records against the/skill-namepattern - Time filtering:
timestampis a millisecond-level timestamp (number), which needs to be divided by 1000 to convert to seconds - Unused skills: displayed as 0 times in the results
- History file locations:
~/.claude/history.jsonland~/.claude/projects/*/*.jsonl
Execution Instructions
When the user invokes this skill, please execute the following steps:
- First, use
AskUserQuestionto ask for the statistics time period - Directly call the
~/.claude/skills/skill-stats/stats.pyscript, passing in the time period parameter - Directly use the script output as the final reply, without any additional processing or wrapping
Time period parameter mapping:
| User selection | Script parameter |
|---|---|
| Today | today |
| Past 7 days | past_7_days |
| Past 30 days | past_30_days |
| Past 90 days | past_90_days |
| All | all |
Call example:
python3 ~/.claude/skills/skill-stats/stats.py past_30_days
- Important: Output the statistics report directly as the final reply to the user, do not only output short descriptions such as "statistics complete"