history-insight
ai-native-camp/camp-2
Access, capture, and analyze Claude Code session history for insights and reference.
What is history-insight?
This skill extracts and analyzes Claude Code session history from local project files. Use it when you need to save, review, summarize, or reference past conversations and work within a coding session.
- Locate and read session history files from ~/.claude/projects/
- Parse JSONL session data and extract user messages and interactions
- Automatically handle large session files with batch processing and parallel analysis
- Filter sessions by date and project scope (current project or all sessions)
- Generate summaries and insights from captured session data
- Handle preprocessing and compression of large files
How to install history-insight
npx skills add https://github.com/ai-native-camp/camp-2 --skill history-insight- jq must be installed (brew install jq on macOS)
- Access to ~/.claude/projects/ directory where session files are stored
How to use history-insight
- 1.Invoke the skill when you mention capturing, saving, or referencing session history
- 2.Specify scope: current project only or all Claude Code sessions (or answer the prompt)
- 3.The skill locates .jsonl session files in the appropriate directory
- 4.For 1-3 files, sessions are read directly; for 4+ files, batch processing is used
- 5.Review the extracted insights and captured session data in the report
Use cases
- Save and review what was discussed in today's coding session
- Extract key decisions and code changes from a multi-day project
- Summarize conversation history for documentation or handoff
- Search across all Claude Code sessions for patterns or past solutions
- Capture session context before closing a project
- Developers using Claude Code for extended projects
- Teams needing session documentation and knowledge capture
- Users reviewing past work or extracting learnings from sessions
history-insight FAQ
Session files are stored in ~/.claude/projects/<encoded-cwd>/*.jsonl, where the directory name is an encoded version of your project path (e.g., /Users/foo/project becomes -Users-foo-project).
For 4 or more files, the skill uses a batch extract pipeline with parallel Task processing to efficiently analyze all sessions without hitting token limits.
Yes. The skill checks file modification time (mtime) and can filter sessions by date range using OS-specific stat commands.
Large files (≥5000 tokens) are automatically preprocessed with extract-session.sh to compress the data by removing thinking and tool_use blocks.
No. The skill uses ~ prefix in output and never exposes full paths in reports for security.
Full instructions (SKILL.md)
Source of truth, from ai-native-camp/camp-2.
name: history-insight description: This skill should be used when user wants to access, capture, or reference Claude Code session history. Trigger when user says "capture session", "save session history", or references past/current conversation as a source - whether for saving, extracting, summarizing, or reviewing. This includes any mention of "what we discussed", "today's work", "session history", or when user treats the conversation itself as source material (e.g., "from our conversation"). version: 1.1.0 user-invocable: true
History Insight
Claude Code 세션 히스토리를 분석하고 인사이트를 추출합니다.
Data Location
~/.claude/projects/<encoded-cwd>/*.jsonl
Path Encoding: /Users/foo/project → -Users-foo-project
상세 파일 포맷:
${baseDir}/references/session-file-format.md
Execution Algorithm
Step 1: Ask Scope [MANDATORY]
스코프 결정:
-
명시된 경우 (AskUserQuestion 생략 가능):
- "현재 프로젝트만" / "이 프로젝트" →
current_project - "모든 세션" / "전체" →
all_sessions
- "현재 프로젝트만" / "이 프로젝트" →
-
명시되지 않은 경우 - AskUserQuestion 호출:
question: "세션 검색 범위를 선택하세요" options: - "현재 프로젝트만" → ~/.claude/projects/<encoded-cwd>/*.jsonl - "모든 Claude Code 세션" → ~/.claude/projects/**/*.jsonl
Step 2: Find Session Files
# Current project only
find ~/.claude/projects/<encoded-cwd> -name "*.jsonl" -type f
# All sessions (모든 프로젝트)
find ~/.claude/projects -name "*.jsonl" -type f
날짜 필터링: 파일의 mtime(수정시간) 확인 후 필터. OS별 stat 옵션 다름:
- macOS:
stat -f "%Sm" -t "%Y-%m-%d" <file> - Linux:
stat -c "%y" <file>
Step 3: Process Sessions
Decision Tree
Session files found?
├─ No → Error: "No sessions found"
└─ Yes → How many files?
├─ 1-3 files → Direct Read + parse
└─ 4+ files → Batch Extract Pipeline
1-3 Files
직접 Read로 JSONL 파싱. 파일이 크면(≥5000 tokens) extract-session.sh 사용:
${baseDir}/scripts/extract-session.sh <session.jsonl>
4+ Files: Batch Extract Pipeline
- 캐시 디렉토리 생성 (
/tmp/cc-cache/<analysis-name>/) - 세션 목록 저장 (
sessions.txt) - jq로 메시지 일괄 추출 (
user_messages.txt) - 정리 및 필터링 (
clean_messages.txt) - Task(opus)로 종합 분석
파일이 너무 클 때: 병렬 배치 분석
clean_messages.txt가 너무 커서 Read 실패 시:
-
파일 분할:
split -l 2000 clean_messages.txt /tmp/cc-cache/<name>/batch_ -
병렬 Task(opus) 호출:
Task(subagent_type="general-purpose", model="opus", run_in_background=true) prompt: "batch_XX 파일을 읽고 주제/패턴 요약해줘" -
결과 병합: Task(opus)로 종합
Step 4: Report Results
## Session Capture Complete
- **Sessions:** N files processed
- **Messages:** X total, Y after filter
### Extracted Insights
[분석 결과]
Error Handling
| Scenario | Response |
|---|---|
| No session files found | "No session files found for this project." |
| File too large | Auto-preprocess with extract-session.sh |
| jq not installed | "Error: jq is required. Install with: brew install jq" |
| Task failed | "Warning: Could not process [file]. Skipping." |
| 0 relevant sessions | "No sessions matched your criteria." |
Security Notes
- 출력에 전체 경로 노출 금지 (
~prefix 사용)
Related Resources
${baseDir}/scripts/extract-session.sh- JSONL 압축 (thinking, tool_use 제거)${baseDir}/references/session-file-format.md- JSONL 구조 및 파싱
Related skills
More from ai-native-camp/camp-2 and the wider catalog.

session-analyzer
Validate Claude Code session behavior against SKILL.md specifications post-execution.

session-wrap
Analyze completed work and wrap up coding sessions with multi-agent insights.

team-assemble
Dynamically assemble and execute specialist teams in parallel for complex multi-role tasks.

compound
Capture and structure verified insights into a searchable knowledge base that compounds over time.

paddleocr-text-recognition
Extract text from images, PDFs, and screenshots with high accuracy for CJK, handwriting, and small print.

bilibili-analyzer
自动分析B站视频内容,下载视频并拆解成帧图片,使用AI分析并生成详细的专题文档或实操教程。