session-analysis

Parse Pi session JSONL files with jq to extract metrics and tool usage.

3|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/oddship/bosun --skill session-analysis-oddship
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-analysis
Source: https://github.com/oddship/bosun/tree/main/.pi/skills/session-analysis
Command: npx skills add https://github.com/oddship/bosun --skill session-analysis-oddship

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes references (resource) components.

What problem does it solve?

This Skill helps you quickly extract valuable insights, metrics, and historical data from Pi session log files, which are often large and complex.

Core Features & Use Cases

  • Session Discovery: Easily locate and list session files.
  • Data Extraction: Use powerful jq patterns to pull specific information like model usage, user prompts, assistant responses, tool calls, and file interactions.
  • Cost & Usage Analysis: Calculate total costs and token usage per session turn.
  • Use Case: After a long AI session, you need to understand which tools were used most frequently and how much it cost. This Skill can parse the session log and provide a summary report.

Quick Start

Use the session-analysis skill to count the number of user messages in the file 'session.jsonl'.

Frequently Asked Questions about session-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract tool usage metrics from Pi session logs?

You can extract tool usage metrics from Pi session logs by applying jq patterns to parse the JSONL files. This process identifies specific tool calls, message types, and interaction frequencies to summarize workflow patterns within the session history.

What is the best way to calculate token costs from a Pi session JSONL file?

The best way to calculate token costs from a Pi session JSONL file is to parse the structured log data using jq. This allows you to extract usage statistics and compute total costs per session turn based on model interactions.

Do I need jq installed to analyze session history and export data?

Yes, you need jq installed because this session analysis process requires it to process structured log data. jq is used to query the JSONL files and extract the necessary metrics, tool usage, and cost data.

Can I summarize assistant responses and user prompts from session logs using jq?

Yes, you can summarize assistant responses and user prompts from session logs using jq. By parsing the JSONL format, jq filters specific message types to isolate user inputs and assistant outputs for session summarization.

How do I locate and list Pi session files for data extraction?

To locate and list Pi session files for data extraction, you can utilize session discovery features within the analysis workflow. This identifies available JSONL log files so you can subsequently parse them for metrics and usage statistics.

What patterns should I look for when parsing session JSONL files for workflow analysis?

When parsing session JSONL files for workflow analysis, you should look for patterns in message types, tool calls, and usage statistics. Identifying these patterns helps track file interactions and model usage throughout the session history.