extracting-session-data
БесплатноЗапускает вложенные скриптыНе проверенLocates, lists, filters, and extracts structured data from Claude Code native session logs. Supports both single and multiple session analysis.
Об этом скилле
Extracting Session Data Skill
Core Responsibility
Provide raw access to Claude Code session logs stored in ~/.claude/projects/{project-dir}/{session-id}.jsonl.
Key Principle: This skill extracts data only - return raw data to calling skills for analysis. Do not analyze or interpret within this skill.
Available Scripts
All scripts located in scripts/ subdirectory relative to this skill.
1. locate-logs.sh
Find log directory or specific session file path.
# Get logs directory for current working directory
scripts/locate-logs.sh
# Get logs directory for specific project
scripts/locate-logs.sh /path/to/project
# Get specific session log file path
scripts/locate-logs.sh /path/to/project abc123-session-id
Use when: Building dynamic paths, verifying logs exist before processing.
2. list-sessions.sh
Enumerate all sessions with metadata (ID, size, lines, date, branch).
# List all sessions (table format)
scripts/list-sessions.sh
# JSON output
scripts/list-sessions.sh --format json
# Sort by size or lines
scripts/list-sessions.sh --sort size
scripts/list-sessions.sh --sort lines
# Specific project
scripts/list-sessions.sh /path/to/project
Output formats: table, json, csv
Sort options: date, size, lines
Use when: Starting retrospective, showing available sessions to user, checking for recent sessions.
3. extract-data.sh
Parse JSONL logs and extract specific data types.
Available extraction types:
metadata- Session info (ID, timestamps, branch, working dir)user-prompts- All user messagestool-usage- Tool call statisticserrors- Failed tool calls with timestampsthinking- Thinking blocks (if extended thinking enabled)text-responses- Assistant text responses onlystatistics- Session metrics (message counts, tool calls, errors)all- Combined extraction
# Extract from specific session
scripts/extract-data.sh --type statistics --session SESSION_ID
scripts/extract-data.sh --type errors --session SESSION_ID
scripts/extract-data.sh --type tool-usage --session SESSION_ID
# Extract from all sessions (omit --session)
scripts/extract-data.sh --type statistics
# Limit output
scripts/extract-data.sh --type user-prompts --limit 10
# Different project
scripts/extract-data.sh --type metadata --project /path/to/project
Use when: Need specific data without loading entire log, generating metrics, identifying errors.
4. filter-sessions.sh
Find sessions matching criteria.
Filter options:
--since DATE- Sessions modified since date ("2 days ago", "2025-10-20")--until DATE- Sessions modified until date--branch NAME- Sessions on specific git branch--min-size SIZE- Minimum file size ("1M", "500K")--max-size SIZE- Maximum file size--min-lines N- Minimum line count--max-lines N- Maximum line count--has-errors- Only sessions with failed tool calls--keyword WORD- Sessions containing keyword
Output formats: list, paths, json
# Recent sessions
scripts/filter-sessions.sh --since "2 days ago"
# Large sessions with errors
scripts/filter-sessions.sh --min-lines 500 --has-errors
# Sessions on main branch in last week
scripts/filter-sessions.sh --branch main --since "7 days ago"
# Sessions containing keyword
scripts/filter-sessions.sh --keyword "authentication"
# Get paths only (for piping)
scripts/filter-sessions.sh --since "1 day ago" --format paths
Use when: User requests analysis of recent sessions, finding sessions for specific feature/branch, identifying problematic sessions.
Working Process
Single Session Analysis
# 1. Verify session exists and get metadata
scripts/extract-data.sh --type metadata --session SESSION_ID
# 2. Get session statistics (to determine size)
scripts/extract-data.sh --type statistics --session SESSION_ID
# 3. Extract specific data as needed
scripts/extract-data.sh --type errors --session SESSION_ID
scripts/extract-data.sh --type tool-usage --session SESSION_ID
Multiple Session Analysis
# 1. Filter to find relevant sessions
scripts/filter-sessions.sh --since "7 days ago" --branch main
# 2. Extract data from all filtered sessions
scripts/extract-data.sh --type statistics
# 3. Or iterate through filtered subset
SESSIONS=$(scripts/filter-sessions.sh --has-errors --format paths)
for session in $SESSIONS; do
SESSION_ID=$(basename "$session" .jsonl)
scripts/extract-data.sh --type errors --session $SESSION_ID
done
Integration Pattern for Calling Skills
When another skill (like retrospecting) needs session data:
- Discovery: Use
list-sessions.shorfilter-sessions.shto find relevant sessions - Size Check: Use
extract-data.sh --type statisticsto determine session complexity - Targeted Extraction: Use
extract-data.shwith specific types for needed data - Return Raw Data: Return extracted dat
Установить extracting-session-data в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл extracting-session-data?
Locates, lists, filters, and extracts structured data from Claude Code native session logs. Supports both single and multiple session analysis.
Как установить скилл extracting-session-data?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл extracting-session-data запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic