
History Insight
- 1.3k installs
- 18 repo stars
- Updated March 22, 2026
- ai-native-camp/camp-2
history-insight is an agent skill for 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.
About
The history-insight skill is designed for 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. --- Data Location Path Encoding: /Users/foo/project → -Users-foo-project > 상세 파일 포맷: ${baseDir}/references/session-file-format.md --- Execution Algorithm Step 1: Ask Scope [MANDATORY] 스코프 결정: 1. 명시된 경우 (AskUserQuestion 생략 가능): "현재 프로젝트만" / "이 프로젝트" → current_project "모든 세션" / "전체" → all_sessions 2. Invoke when the user asks about history insight or related SKILL.md workflows.
- macOS: stat -f "%Sm" -t "%Y-%m-%d" <file>.
- Linux: stat -c "%y" <file>.
- Sessions: N files processed.
- Messages: X total, Y after filter.
- 출력에 전체 경로 노출 금지 (~ prefix 사용).
History Insight by the numbers
- 1,262 all-time installs (skills.sh)
- +3 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #908 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Security screen: HIGH risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
history-insight capabilities & compatibility
- Capabilities
- macos: stat f "%sm" t "%y %m %d" <file> · linux: stat c "%y" <file> · sessions: n files processed · messages: x total, y after filter
What history-insight says it does
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 referen
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
npx skills add https://github.com/ai-native-camp/camp-2 --skill history-insightAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.3k |
|---|---|
| repo stars | ★ 18 |
| Security audit | 1 / 3 scanners passed |
| Last updated | March 22, 2026 |
| Repository | ai-native-camp/camp-2 ↗ |
How do I 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?
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.
Who is it for?
Developers using history insight workflows documented in SKILL.md.
Skip if: Skip when the task falls outside history-insight scope or needs a different stack.
When should I use this skill?
User asks about history insight or related SKILL.md workflows.
What you get
Completed history-insight workflow with documented commands, files, and expected deliverables.
- filtered conversation transcript
- JSONL type size breakdown
By the numbers
- Documents 6 JSONL record types in Claude Code session files
- Example 12MB session: 94% metadata vs 6% actual conversation
Files
History Insight
Claude Code 세션 히스토리를 분석하고 인사이트를 추출합니다.
---
Data Location
~/.claude/projects/<encoded-cwd>/*.jsonlPath Encoding: /Users/foo/project → -Users-foo-project
상세 파일 포맷: ${baseDir}/references/session-file-format.md---
Execution Algorithm
Step 1: Ask Scope [MANDATORY]
스코프 결정:
1. 명시된 경우 (AskUserQuestion 생략 가능):
- "현재 프로젝트만" / "이 프로젝트" →
current_project - "모든 세션" / "전체" →
all_sessions
2. 명시되지 않은 경우 - 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 Pipeline1-3 Files
직접 Read로 JSONL 파싱. 파일이 크면(≥5000 tokens) extract-session.sh 사용:
${baseDir}/scripts/extract-session.sh <session.jsonl>4+ Files: Batch Extract Pipeline
1. 캐시 디렉토리 생성 (/tmp/cc-cache/<analysis-name>/) 2. 세션 목록 저장 (sessions.txt) 3. jq로 메시지 일괄 추출 (user_messages.txt) 4. 정리 및 필터링 (clean_messages.txt) 5. Task(opus)로 종합 분석
파일이 너무 클 때: 병렬 배치 분석
clean_messages.txt가 너무 커서 Read 실패 시:
1. 파일 분할:
split -l 2000 clean_messages.txt /tmp/cc-cache/<name>/batch_2. 병렬 Task(opus) 호출:
Task(subagent_type="general-purpose", model="opus", run_in_background=true)
prompt: "batch_XX 파일을 읽고 주제/패턴 요약해줘"3. 결과 병합: 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 구조 및 파싱
Session File Format (.jsonl)
Claude Code 세션 파일의 상세 구조 및 파싱 방법
JSONL Type 분류
| type | 설명 | 필요 여부 |
|---|---|---|
user | 사용자 메시지 | ✅ 필요 |
assistant | Claude 응답 | ✅ 필요 (text만) |
file-history-snapshot | 파일 백업 스냅샷 | ❌ 버림 |
queue-operation | 큐 연산 로그 | ❌ 버림 |
system | 시스템 메시지 | ⚪ 선택 |
summary | 세션 요약 | ⚪ 선택 |
실제 분석 결과 (12MB 파일 예시)
| Type | Lines | Size | 비율 |
|---|---|---|---|
file-history-snapshot | 7,984 | 8.4MB | 67% |
queue-operation | 15,948 | 3.4MB | 27% |
user | 127 | 542KB | 4% |
assistant | 163 | 255KB | 2% |
system | 13 | 9KB | <1% |
summary | 5 | 600B | <1% |
결론: 실제 대화는 6%, 나머지 94%는 메타데이터
assistant 메시지 내부 구조
.message.content[] 배열 내부:
| 내부 type | 설명 | 필요 여부 |
|---|---|---|
thinking | Claude 생각 과정 + signature | ❌ 버림 |
tool_use | tool 호출 정보 | ❌ 버림 |
text | 실제 응답 텍스트 | ✅ 필요 |
JSON 파싱 명령어
user 메시지 추출:
jq -c 'select(.type == "user") | {type, content: .message.content, ts: .timestamp}' <file.jsonl>assistant 메시지 추출 (text만):
jq -c 'select(.type == "assistant") | {type, texts: [.message.content[] | select(.type == "text") | .text], ts: .timestamp}' <file.jsonl>한 번에 대화만 추출:
jq -c '
if .type == "user" then
{type: "user", content: .message.content, ts: .timestamp}
elif .type == "assistant" then
{type: "assistant", texts: [.message.content[]? | select(.type == "text") | .text], ts: .timestamp}
| select(.texts | length > 0)
else empty end
' <file.jsonl>결과: 12MB → ~160KB (99% 감소)
#!/bin/bash
# extract-session.sh
# Extract essential conversation from Claude Code session JSONL files
#
# Usage: ./extract-session.sh <session.jsonl>
# Output: Filtered JSON to stdout
#
# ============================================================
# 세션 파일 구조 분석 결과 (12MB 파일 예시)
# ============================================================
#
# JSONL type 분포:
# file-history-snapshot : 67% (8.4MB) → 버림
# queue-operation : 27% (3.4MB) → 버림
# user + assistant : 6% (800KB) → 추출
# system, summary : <1% → 선택적
#
# assistant.message.content[] 내부:
# thinking : Claude 생각 + signature → 버림
# tool_use : tool 호출 정보 → 버림
# text : 실제 응답 텍스트 → 추출
#
# 결과: 12MB → ~800KB (93% 감소)
# ============================================================
set -e
SESSION_FILE="$1"
if [ -z "$SESSION_FILE" ]; then
echo "Usage: $0 <session.jsonl>" >&2
exit 1
fi
if [ ! -f "$SESSION_FILE" ]; then
echo "Error: File not found: $SESSION_FILE" >&2
exit 1
fi
if ! command -v jq &> /dev/null; then
echo "Error: jq is required. Install with: brew install jq" >&2
exit 1
fi
# Extract conversation only:
# - summary: 세션 요약
# - user: 사용자 메시지 (.message.content)
# - assistant: Claude 응답 중 text만 (.message.content[].type == "text")
#
# Explicitly ignored (94% of file size):
# - file-history-snapshot: 파일 백업 스냅샷
# - queue-operation: 큐 연산 로그
# - assistant.thinking: 생각 과정 + signature
# - assistant.tool_use: tool 호출 정보
jq -c '
if .type == "summary" then
{type: "summary", summary: .summary}
elif .type == "user" then
{
type: "user",
content: .message.content,
ts: .timestamp
}
elif .type == "assistant" then
{
type: "assistant",
texts: [.message.content[]? | select(.type == "text") | .text],
ts: .timestamp
} | select(.texts | length > 0)
else
empty
end
' "$SESSION_FILE" 2>/dev/null | jq -s '{
file: "'"$SESSION_FILE"'",
message_count: length,
messages: .
}'
Related skills
How it compares
Pick history-insight over generic JSONL tools when the source is Claude Code sessions with embedded file snapshots and queue logs.
FAQ
What does history-insight do?
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.
When should I use history-insight?
User asks about history insight or related SKILL.md workflows.
Is history-insight safe to install?
Review the Security Audits panel on this page before installing in production.