cc-insights
SKILL.md
CC Insights
Automated archiving and deep analysis of Claude Code interaction history.
Workflow
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Archive │ ──► │ Analyze │ ──► │ Ask User │ ──► │ Report │
│ Chats │ │ Patterns │ │ (2 phases) │ │ + Summary │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
Path Variables
| Variable | Description | Default |
|---|---|---|
[ARCHIVE_ROOT] |
Where archives are saved | Run archive_chats.py to see output path |
<skill_root> |
This skill's directory | Directory containing this SKILL.md |
[TIME_FILTER] |
Time range parameter | See references/time_filter_guide.md |
Standard Workflow
User: "归档并分析我的CC聊天记录"
- Run
archive_chats.pyto convert JSONL → Markdown (note the output path as[ARCHIVE_ROOT]) - Run
analyze_patterns.pyto extract patterns - Offer analysis options via AskUserQuestion (2 phases)
Post-Archiving Analysis Menu
After archiving, offer options using AskUserQuestion in two phases:
Phase 1: Time Range (Parameter)
Time range is a parameter, not an agent set. It filters all subsequent analysis.
| Selection | [TIME_FILTER] Value |
[TIME_SUMMARY_PREFIX] |
|---|---|---|
| 全量分析 (All) | from all available history |
基于全部历史数据分析 |
| 近月分析 (30d) | from the last 30 days only |
基于近30天数据分析 |
| 本周分析 (7d) | from the last 7 days only |
基于近7天数据分析 |
Phase 2: Analysis Dimensions (Agent Set)
Each dimension launches its own set of agents, all receiving the time filter.
| Selection | Reference File | Agents |
|---|---|---|
| 多维度深度分析 | references/deep_analysis_agents.md |
7 |
| 人工干预分析 | references/human_input_analysis.md |
5 |
| 模式归类 | references/pattern_grouping.md |
5 |
AskUserQuestion Template
questions:
- question: "归档完成!选择时间范围分析?"
header: "时间范围"
multiSelect: false
options:
- label: "全量分析 (All)"
description: "分析所有历史交互,总结模式,提出改进建议"
- label: "近月分析 (30d)"
description: "分析近30天交互模式和使用习惯"
- label: "本周分析 (7d)"
description: "分析近7天交互,适合周度复盘"
- question: "选择分析维度?"
header: "分析维度"
multiSelect: true
options:
- label: "多维度深度分析"
description: "7个领域专项agent并行分析(技能开发、知识管理、内容创作等)"
- label: "人工干预分析"
description: "分析首次任务后的用户介入,识别改进点"
- label: "模式归类"
description: "识别重复输入,建议创建command/skill/agent"
Required Permissions
Before running this skill, ensure these paths are in ~/.claude/settings.json under permissions.allow:
"permissions": {
"allow": [
"Read(~/.claude/skills/cc-insights/**)",
"Read(~/ClaudeCodeArchive/**)",
"Read(~/SynologyDrive/ClaudeCodeArchive/**)"
]
}
Execution Logic
Based on user selections:
- Extract time range from Phase 1 selection
- Read
references/time_filter_guide.mdto get[TIME_FILTER]and[TIME_SUMMARY_PREFIX]values - For each selected dimension in Phase 2:
- Read the corresponding reference file
- Replace
[TIME_FILTER]in all agent prompts with the time filter value - Replace
[ARCHIVE_ROOT]with the actual archive path - Launch all agents in parallel using Task tool with
subagent_type=Explore - CRITICAL: Prefix each agent prompt with:
IMPORTANT: Only use Read, Glob, and Grep tools. Do NOT use any browser, web, or network tools. You have permission to read all files under [ARCHIVE_ROOT].
- Synthesize results into a single report
- Apply output naming based on time range (see
time_filter_guide.md)
Example: User selects "本周分析 (7d)" + "多维度深度分析"
[TIME_FILTER]=from the last 7 days only[TIME_SUMMARY_PREFIX]=基于近7天数据分析- Read
references/deep_analysis_agents.md - For each of the 7 agent prompts, replace
[TIME_FILTER]with the filter value - Launch 7 agents (all filtered to last 7 days)
- Output file:
CC_Weekly_MultiDim_YYYYMMDD.md
Scripts Reference
Scripts are in scripts/ subdirectory relative to this SKILL.md.
python3 <skill_root>/scripts/<script_name>.py [OPTIONS]
archive_chats.py
| Option | Description |
|---|---|
--full |
Include tool call details |
--project NAME |
Filter by project name |
--since YYYY-MM-DD |
Archive only after date |
--output DIR |
Custom output directory (see script for default) |
analyze_patterns.py
| Option | Description |
|---|---|
--output FILE |
Save JSON to file |
--pretty |
Pretty-print JSON |
generate_insights.py
| Option | Description |
|---|---|
--analysis FILE |
Input analysis JSON |
--output FILE |
Output Markdown path |
Additional References
references/time_filter_guide.md- Time parameter values and output namingreferences/deep_analysis_agents.md- 7 domain-specific agentsreferences/human_input_analysis.md- 5 intervention analysis agentsreferences/pattern_grouping.md- 5 pattern mining agentsreferences/workflow.md- Automation setup, cron jobs, best practices
Weekly Installs
2
Repository
xueheng-li/ai-t…allationGitHub Stars
14
First Seen
6 days ago
Security Audits
Installed on
amp2
cline2
opencode2
cursor2
kimi-cli2
codex2