session-logs

Search and analyze JSONL conversation session logs using jq and ripgrep.

1|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/Cyandex/ErnOS --skill session-logs-cyandex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: session-logs
Source: https://github.com/Cyandex/ErnOS/tree/main/skills/session-logs
Command: npx skills add https://github.com/Cyandex/ErnOS --skill session-logs-cyandex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, rg.

What problem does it solve? When a user references older or parent conversations that are no longer in active memory, there is no built-in way to recall what was said. This Skill provides ready-to-use jq and ripgrep commands to search, filter, and analyze complete conversation history stored in session JSONL files. ## Core Features & Use Cases - Full-Text Session Search: Search across all session transcripts for keywords or phrases using ripgrep, or filter by role (user, assistant, toolResult) with jq. - Usage and Cost Analytics: Compute per-session and daily cost totals, message counts, and token usage from the message.usage.cost.total fields. - Tool Usage Breakdown: Aggregate which tools were called and how often within any session transcript. - Use Case: A user asks "what did we decide about the database schema last Tuesday?" You locate sessions from that date, extract the user and assistant text messages, and search for the relevant discussion. ## Quick Start Search my session logs for any past conversation where we discussed database migration and summarize what was decided.

Frequently Asked Questions about session-logs

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

FAQPage Schema
How do I search past conversation history stored in JSONL files?▼

Use ripgrep to search across all session files for a phrase, then use jq to extract readable text by filtering messages where content type equals text. Session transcripts live in the agent's sessions directory as one JSON object per line.

How to extract only user messages from a session transcript with jq?▼

Filter with jq by selecting entries where message.role equals user, then iterate over message.content items where type equals text and print the text field. This excludes assistant replies, thinking blocks, and tool calls.

Can I calculate the total cost of a conversation session?▼

Yes. Each message entry contains a message.usage.cost.total field. Use jq with the slurp flag to sum all cost values in a session file, or loop over all session files to build a daily cost summary grouped by date.

What tools are required to analyze session JSONL logs?▼

The workflow requires jq for parsing and filtering JSON lines and ripgrep (rg) for fast text search across files. Standard Unix utilities like head, sort, awk, and uniq are used for aggregation and summaries.

Why does my jq query return no output on a session file?▼

Session files contain mixed entry types, including session metadata entries without a message field. Ensure your filter selects type message entries first, and verify you are reading the correct session ID from the sessions.json index.