Session Logs for Openclaw

A comprehensive forensic toolkit for analyzing Openclaw session history to monitor costs, tool usage, and agent regressions.

danielsinewe
v0.2.0
Apr 6, 2026
0
782
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install openclaw-session-log-forensics

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install openclaw-session-log-forensics using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Session Logs?

The Session Logs skill is a developer-centric forensic tool designed for Openclaw operators who need deep visibility into their AI agent interactions. By parsing the append-only JSONL files generated during sessions, this skill enables users to perform complex queries using jq and ripgrep (rg). It is specifically built to help users navigate the Openclaw Skills ecosystem more effectively by providing a clear audit trail of every conversation, cost metric, and tool call made by an agent.

This tool is indispensable for maintaining the health of your AI workflows. It allows you to move beyond simple chat interfaces and treat your interaction history as a structured database, making it possible to identify performance drift and operational inefficiencies that would otherwise remain hidden in raw log files.

Session Logs Use Cases

  • Performing forensic audits after identifying unexpected cost spikes in AI operations.
  • Retrieving historical context or parent conversation data that is no longer in active memory.
  • Monitoring tool-call drift to ensure agents are utilizing available Openclaw Skills correctly.
  • Generating daily usage reports and message volume summaries for agent management.
  • Triaging behavior regressions by comparing session snapshots before and after updates.

How Session Logs Works

  1. The skill locates session data within the agent-specific directory at ~/.openclaw/agents//sessions/.
  2. It maps session keys to unique IDs using the sessions.json index file.
  3. It processes .jsonl files, which store individual messages, timestamps, and usage metadata as discrete JSON objects.
  4. Using specialized jq filters, the skill extracts human-readable text, calculates aggregate costs, or counts tool-call frequencies.
  5. Ripper (rg) is employed for high-speed keyword searching across the entire history of an agent's interactions.

Session Logs Setup

To use this skill, ensure that the jq and rg binaries are installed on your system. You can verify your setup by navigating to your agent's session directory:

cd ~/.openclaw/agents/<agentId>/sessions/
ls -lh

No further internal configuration is needed within the Openclaw Skills framework, as the skill operates directly on the generated log files.

Session Logs Data Schema & Taxonomy

The skill organizes and interprets data using the following file structure and metadata schema:

Component Format Purpose
sessions.json JSON Index Maps chat provider keys to specific session IDs for easy lookup.
.jsonl JSON Lines The primary transcript containing timestamped message and cost objects.
message.role String Identifies the speaker as user, assistant, or toolResult.
usage.cost.total Number Tracks the financial cost of each individual response.
toolCall Object Metadata capturing the specific Openclaw Skills invoked by the agent.

Session Logs Advanced Features

  • Threshold anomaly flagging to automatically identify sessions exceeding specific cost or tool-call limits.
  • Regression analysis scripts to compare the message mix and tool usage between two different session IDs.
  • Compact forensic snapshots that generate shareable summaries of agent behavior for incident reports.
  • High-performance text-only filtering to reduce noise when searching for specific human-readable content across thousands of logs.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins jqrg
Github Stars: 0
forks: 0

Featured*