MyClaw
HomeProductsUse CasesPricingSkillsResourcesCompany
HomeUse CasesPricingSkills
Sign In
Home
ProductsOpenClaw HostingHermes Agent Hosting
Use CasesPricingSkills
ResourcesCompareTutorialLearnBlogUpdatesResourcesCommunity
CompanyAboutSupport
Sign In
MyClaw.ai

Your AI agent, already running.

Product

OpenClaw HostingHermes Agent HostingUse CasesPricingCompareAlibaba Cloud

Resources

BlogUpdatesSkillsModelsSupportCommunityCapybara

Legal

TermsPrivacyCookieGDPRContact

© 2023 Cubo World Inc. All rights reserved.

← Back to Skills
Coding Agents & IDEs
📜

session-logs

Search and analyze your OpenClaw conversation history across session JSONL files using jq and ripgrep.

by OpenClawv1.0.0
ProductivityCLISelf-HostedDeveloper Tool
Connecting to VM...
Connecting to VM...
npx clawhub@latest install session-logs
41Current Installs
📦
v1.0.0Version

Requirements

jqrg

session-logs Skill Overview

The session-logs skill gives your AI agent the ability to search, filter, and analyze its own historical conversation logs stored as JSONL files in ~/.openclaw/agents/<agentId>/sessions/. When a user references something said in a prior chat or asks about past context that isn't in memory files, this skill provides the queries needed to retrieve it. It leverages jq for structured JSON processing and rg (ripgrep) for fast full-text search across potentially large session archives.

How to Use It

Step 1: Run in your terminal or install this skill on MyClaw

npx clawhub@latest install session-logs
or

Click the Install button at the top of this page for one-click setup

When to Use session-logs

Best Fit

  • The user asks "what did we talk about last week?" or references a prior conversation not in current memory.
  • You need to calculate session costs, count messages, or summarize tool usage across historical chats.
  • You want to search for a specific keyword or phrase across all past sessions quickly.
  • You need to identify sessions by date, size, or provider (Discord, WhatsApp, etc.) using the sessions.json index.

When Not to Use

  • The context you need is already available in the current conversation window or memory files — no need to hit the filesystem.
  • You are working in an environment where ~/.openclaw/agents/ session storage does not exist or is not accessible.

Key Features

Full-text search across all sessions

Use rg (ripgrep) to search every session JSONL file for a phrase or keyword in a single command. Quickly locate which sessions contain relevant content without reading each file manually.

Structured message filtering with jq

Extract user messages, assistant responses, tool calls, or thinking blocks independently using jq selectors on the .message.role and .message.content[].type fields. Filters out noise like tool results automatically.

Cost and usage analytics

Aggregate message.usage.cost.total across a session or across all sessions by day to produce cost summaries. Also supports counting messages, calculating session duration, and breaking down tool usage by frequency.

Session discovery and indexing

List all sessions sorted by date and file size, find sessions from a specific day, or consult sessions.json to map chat providers (Discord, WhatsApp, etc.) to session IDs.

Handles large JSONL files gracefully

Sessions are append-only JSONL files that can grow to several MB. The skill's query patterns include head/tail sampling tips and streaming jq usage to avoid loading entire files into memory unnecessarily.

Use Cases

Retrieving prior conversation context

When a user says "remember when we discussed X last month?", the agent uses this skill to search session files by date or keyword and surface the relevant exchange, even if it's no longer in the active context window.

Daily and per-session cost auditing

A developer wants to understand how much each conversation is costing. This skill aggregates cost.total per session and groups results by day, producing a readable cost breakdown across the entire agent history.

Tool usage analysis

An operator wants to know which tools the agent calls most frequently. This skill extracts toolCall entries from session logs, counts them, and ranks them — useful for debugging or optimizing agent behavior.

Cross-session keyword search

A user asks whether a particular topic (e.g. a project name, a decision) was ever discussed. The agent runs a ripgrep search across all JSONL files and returns matching session paths for follow-up exploration.

Connecting to VM...
npx clawhub@latest install session-logs
41Current Installs
📦
v1.0.0Version

Requirements

jqrg

FAQ

Reviews

0 reviews

Log in to write a review

No reviews yet. Be the first to share your experience!