.claude/skills/session/SKILL.md
Analyze Claude Code session transcripts — search, summarize, list, or inspect how a session went.
npx skillsauth add leogodin217/leos_claude_starter sessionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze Claude Code session transcripts — search for sessions, summarize them, or perform ad-hoc analysis of how a session went.
A Python analyzer is available at ~/.claude/skills/session/analyzer.py. Run it via Bash.
# List recent sessions (all projects) — shows custom titles from /rename
python3 ~/.claude/skills/session/analyzer.py list --recent 20
# List ALL sessions for a project (no limit)
python3 ~/.claude/skills/session/analyzer.py list --project -home-leo-projects-fabulexa-sim --all
# List sessions for a specific project
python3 ~/.claude/skills/session/analyzer.py list --project -home-leo-projects-fabulexa-sim
# Find sessions by custom title (set via /rename in Claude Code)
python3 ~/.claude/skills/session/analyzer.py find "wtf_sprint_execution"
python3 ~/.claude/skills/session/analyzer.py find "sprint" --project -home-leo-projects-fabulexa-sim
# Search sessions by keyword in transcript content (searches main JSONL + tool-results + subagents)
# Shows context snippets around each match
python3 ~/.claude/skills/session/analyzer.py search "implement-sprint" --recent 50
python3 ~/.claude/skills/session/analyzer.py search "implement-sprint" --all # search all sessions, not just recent
python3 ~/.claude/skills/session/analyzer.py search "implement-sprint" --verbose # also warns on unknown JSONL types
# Get just the path of the Nth search result
python3 ~/.claude/skills/session/analyzer.py search "implement-sprint" --index 5
# Summarize a session (accepts path, UUID, or custom title)
python3 ~/.claude/skills/session/analyzer.py summary /path/to/session.jsonl
python3 ~/.claude/skills/session/analyzer.py summary "wtf_sprint_execution"
# Deep summary — aggregates parent + all subagent transcripts
python3 ~/.claude/skills/session/analyzer.py summary /path/to/session.jsonl --deep
python3 ~/.claude/skills/session/analyzer.py summary --search "keyword" --index 2 --deep
# Summarize directly from search results (preferred for search-then-inspect flows)
python3 ~/.claude/skills/session/analyzer.py summary --search "implement-sprint" --index 5
# Extract conversation flow (user prompts + assistant responses)
python3 ~/.claude/skills/session/analyzer.py conversation /path/to/session.jsonl --max-chars 800
python3 ~/.claude/skills/session/analyzer.py conversation --search "keyword" --index 2
# Tool usage timeline
python3 ~/.claude/skills/session/analyzer.py tools /path/to/session.jsonl
python3 ~/.claude/skills/session/analyzer.py tools --search "keyword" --index 2
# Compare two sessions — token usage, tool counts, duration, files touched
python3 ~/.claude/skills/session/analyzer.py diff SESSION_A SESSION_B
Sessions can be named via /rename in Claude Code. Names are stored as {"type": "custom-title", "customTitle": "..."} entries in the session JSONL. Named sessions appear with [title] prefix in list and search output, and can be looked up directly via find or passed to summary/conversation/tools.
Search covers three sources per session:
<uuid>/tool-results/*.txt) — large tool outputs stored separately from the JSONL<uuid>/subagents/*.jsonl) — Agent tool invocationsContext snippets (~80 chars) are shown around each match. Source labels ([tool-result], [subagent]) indicate where non-main matches came from.
summary --deep aggregates across the parent session and all its subagent transcripts:
diff SESSION_A SESSION_B shows side-by-side comparison of:
Sessions are stored at ~/.claude/projects/<project-slug>/<session-uuid>.jsonl. Each session may also have:
<session-uuid>/subagents/*.jsonl — subagent transcripts (one per Agent tool invocation)<session-uuid>/tool-results/toolu_<id>.txt — externalized tool results (large outputs stored separately)Each line in a session JSONL is one of these types:
| Type | What it is |
|------|-----------|
| user | User messages, command invocations, tool results |
| assistant | Claude responses (text, thinking, tool_use blocks) |
| custom-title | Session name set via /rename. Last entry wins (renames append, don't replace) |
| progress | Granular execution tracking (bash, agent, hook progress) |
| queue-operation | Background task enqueue/dequeue |
| file-history-snapshot | File version tracking |
| system | Turn duration metrics |
| last-prompt | Records the last user prompt for session resume |
Use --verbose with search or summary to detect any types not in this known set.
{
"type": "user" | "assistant" | ...,
"uuid": "...",
"parentUuid": "...", // conversation threading
"sessionId": "...",
"timestamp": "ISO-8601",
"cwd": "/working/dir",
"version": "2.1.x",
"message": {
"role": "user" | "assistant",
"content": [...], // text, tool_use, tool_result blocks
"model": "claude-opus-4-6", // assistant messages only
"usage": { // assistant messages only
"input_tokens": N,
"output_tokens": N,
"cache_read_input_tokens": N,
"cache_creation_input_tokens": N
}
}
}
{"type": "custom-title", "customTitle": "my_session_name", "sessionId": "uuid"}
A session can have multiple custom-title entries (each /rename appends a new one). The last entry is the current name.
Slash commands appear as XML in user message content:
<command-name>/implement-sprint</command-name>
<command-message>implement-sprint</command-message>
{"type": "tool_use", "id": "toolu_...", "name": "Bash", "input": {"command": "..."}}
{"type": "tool_result", "tool_use_id": "toolu_...", "content": "..."}
When asked to analyze a session beyond what the tool provides, read the JSONL directly. Common analyses:
summary --deep to get the overview including subagent aggregationconversation to see the flowSearch assistant messages for keywords that indicate an agent struggled or deviated from its instructions. Use inline Python to scan the JSONL:
Keywords to search for:
"actually", "wait", "wrong", "mistake", "let me reconsider", "should have""spec says", "not what the spec", "different approach", "intentional", "skip", "omit""revert", "undo", "let me try", "didn't work", "failed""circular", "lazy import", "workaround", "hack""refactor", "restructur", "redesign", "not implement"Search both the main session and all subagent transcripts. Extract ~60 chars before and 100 chars after each match for context.
Analyze where context tokens were wasted. Key metrics:
file_path appears in Read tool_use blocks per agent. Any file read 2+ times is waste.cache_read_input_tokens + input_tokens + cache_creation_input_tokens per assistant turn. Look for spikes (large tool results) and plateaus (agent spinning).tool_result blocks by byte size. The top 5 largest results often reveal unnecessary full-file reads or verbose command output.Find which session created or modified a specific file:
# Search for Write tool_use blocks with matching file_path
python3 -c "
import json
path = '/path/to/session.jsonl'
target = 'path/to/file.py'
with open(path) as f:
for line in f:
if target in line and 'tool_use' in line:
msg = json.loads(line)
# check for Write/Edit tool calls
"
Or use search to find sessions mentioning the filename, then inspect the matching session's tool timeline.
Subagent filenames (agent-a589d2e5...) don't describe their purpose. To map them:
Task tool_use blocks — the description field names the subagent (e.g., "Implement Phase 1: Config + Types")id returned in the tool_result matches the subagent filename suffixTaskOutput blocks to see what each subagent returned# List all subagents with their sizes and durations
for f in /path/to/session-uuid/subagents/*.jsonl; do
python3 ~/.claude/skills/session/analyzer.py summary "$f" 2>&1 | grep -E "(Path|Size|Duration)"
done
cache_read_input_tokens vs cache_creation_input_tokens — high cache reads = good reuseThe tool handles listing, searching (with context snippets), summarizing (with --deep aggregation), conversation extraction, tool timelines, and session comparison (diff). For these analyses, read the JSONL directly:
diff for two sessions, but not for duplication within a session's subagentsdevelopment
Spec-fidelity verification tracing requirements through code.
testing
Course designer mode for creating exercises, configs, and QA criteria.
testing
System architect mode for designing interfaces, contracts, and architecture decisions.
testing
Comprehensive test review using parallel test-reviewer agents.