Session Logs — OpenClaw Skill

Search and analyze agent conversation history stored in session JSONL files.

Analytics Vetted

What This Skill Does

The Session Logs skill gives your OpenClaw agent the ability to search and analyze its own conversation history. Every OpenClaw session is stored as a JSONL file containing the complete transcript: user messages, assistant responses, tool calls, usage data, and costs. This skill uses jq and rg (ripgrep) to query these files efficiently, letting your agent recall past conversations, find specific discussions, and track usage patterns.

Common use cases include finding sessions from a specific date, searching for keywords across all past conversations, extracting user or assistant messages from a particular session, calculating per-session and daily costs, counting messages and tokens, and breaking down which tools were used most frequently. This is invaluable when you need your agent to reference something you discussed days or weeks ago.

Session logs are stored at ~/.openclaw/agents/<agentId>/sessions/ as append-only JSONL files. The skill is read-only -- it never modifies session data. It pairs well with the Model Usage skill for cost analysis and the Healthcheck skill for auditing agent behavior over time.

Example Prompts

What did we discuss last Tuesday? Search my session logs for conversations from that date

Find all sessions where I mentioned "database migration" and summarize what was decided

How much has this agent cost me this week? Show a daily cost breakdown

Show me a breakdown of which tools I've used most in my sessions

List all my sessions from the last 7 days sorted by size so I can see the longest conversations

Extract all the user messages from yesterday's session so I can review what I asked

Search across all my sessions for any mention of "API key rotation"

Requirements

Binary dependencies: jq and rg (ripgrep)

  • macOS: brew install jq ripgrep
  • Ubuntu/Debian: apt install jq ripgrep
  • Session data: OpenClaw must have stored session JSONL files

Setup on KiwiClaw

Session Logs is available on all KiwiClaw plans. Both jq and rg are pre-installed on every tenant machine. Session data is automatically stored and queryable. View high-level analytics in the KiwiClaw dashboard, or use this skill for detailed deep-dives into conversation history.

Setup Self-Hosted

  1. Install jq: brew install jq (macOS) or apt install jq (Linux)
  2. Install ripgrep: brew install ripgrep (macOS) or apt install ripgrep (Linux)
  3. Verify session data exists: ls ~/.openclaw/agents/*/sessions/*.jsonl
  4. The skill will be automatically available to OpenClaw once jq and rg are on the PATH

Related Skills

  • Model Usage -- track per-model costs alongside session costs
  • Healthcheck -- audit agent behavior patterns for security
  • Bear Notes -- save important session findings to Bear
  • ClawHub -- check which skills were used in past sessions

FAQ

What can the Session Logs skill do in OpenClaw?

Session Logs lets your OpenClaw agent search its own conversation history: list sessions by date, find sessions containing specific keywords, extract user or assistant messages, calculate per-session costs, get daily cost summaries, count messages and tokens, and break down tool usage patterns.

Where are session logs stored?

Session logs are stored at ~/.openclaw/agents/<agentId>/sessions/ as JSONL files. Each file contains the complete conversation transcript for one session, including messages, tool calls, and usage/cost data. Learn more about data handling in our SOC2 and GDPR compliance guide.

Can I search across all past sessions at once?

Yes. Use ripgrep (rg) to search across all session JSONL files for any keyword or phrase. The skill provides optimized jq queries for extracting structured data from individual sessions and rg patterns for cross-session text search.

Is the Session Logs skill safe to use?

The Session Logs skill has been security-vetted by KiwiClaw. It only reads local JSONL files and never transmits conversation data externally. All queries are read-only -- session files are never modified.

Search your conversation history

Find past discussions, track costs, and analyze usage patterns -- all through natural language.