Skip to main content

Crate normalize_session_analysis

Crate normalize_session_analysis 

Source
Expand description

Session analysis types and functions.

This module computes analytics from parsed Session data. Analysis is intentionally in the CLI, not the parsing library, because what metrics matter is subjective and consumer-specific.

Structs§

CommandCategory
CommandDetail
Detail for a specific command pattern within a category.
CommandStats
Statistics for a command category (e.g., “build”, “test”, “git”).
Correction
An assistant correction or apology.
CostBreakdown
Cost breakdown for a session.
DedupTokenStats
Token deduplication statistics.
ErrorPattern
A recurring error pattern.
FileOperation
File operation statistics.
LargestToolResult
A single large tool result, for the top-N results by character count.
ModelPricing
Model pricing information (per million tokens).
RetryHotspot
A command pattern that failed and was retried.
SessionAnalysisReport
Complete analysis of a session.
TokenStats
Token usage statistics.
ToolChain
A sequence of consecutive single-tool calls (potential parallelization).
ToolPattern
A common tool pattern across sessions.
ToolStats
Statistics for a single tool.

Enums§

CorrectionKind
Type of correction made by the assistant.

Functions§

analyze_session
Analyze a parsed session and compute statistics.
categorize_command
Categorize a single shell command and return category + normalized pattern.
categorize_error
Categorize an error by its content.
detect_correction
Detect correction patterns in assistant text. Returns (category, excerpt) if a correction is found.
extract_tool_patterns
Extract all subsequences of length 2-5 from tool chains.
normalize_path
Normalize a file path for aggregation.