Session Logs
Search and analyze your own session logs (older/parent conversations) using jq. Query conversation history stored in JSONL files.
The Session Logs skill gives OpenClaw the ability to search and analyze its own past conversation history. OpenClaw stores session data as JSONL (JSON Lines) files — one JSON object per line representing each message exchange. This skill teaches the agent to query those logs using `jq` (the command-line JSON processor) and `rg` (ripgrep, a fast search tool).
This is essentially giving your AI agent memory archaeology capabilities. 'What did we discuss about the API redesign last Tuesday?' or 'Find every time I mentioned budget constraints' become answerable by searching through historical session files. The skill handles the JSONL format parsing, timestamp filtering, role-based filtering (user vs assistant messages), and content search.
The session log files live in OpenClaw's data directory (typically `~/.openclaw/sessions/` or similar), organized by session ID and date. Each line contains the message role, content, timestamp, and metadata. The skill's jq recipes extract meaningful patterns from this raw data.
For OpenClaw users, this skill bridges the gap between session-level context (what the AI remembers in the current conversation) and long-term history (what happened days or weeks ago). It's particularly useful for users who have extensive interaction histories and want to reference past decisions, find previous code solutions, or track the evolution of a project discussion.
The skill pairs naturally with OpenClaw's memory system (MEMORY.md, daily memory files) but operates at a lower level — raw transcript search vs. curated memory. Think of it as grep for your AI conversations.
Best suited for: power users with long interaction histories, debugging past agent behavior, finding previous solutions or decisions, anyone wanting searchable conversation archives.
Tags: logs, history, search, debugging
Category: Developer Tools
Use Cases
- Find past decisions: 'When did we decide to use PostgreSQL instead of MongoDB?'
- Recall code solutions: 'Show me the regex pattern we used for email validation'
- Track project evolution: search for mentions of a project across all sessions
- Debug agent behavior: review what the agent said/did in a previous session
- Audit trail: check what actions were taken on a specific date
- Context recovery: pull relevant past discussion into the current session
Tips
- Use `rg` for fast text search across all session files, then `jq` for structured extraction
- Filter by date range to narrow searches: `jq 'select(.timestamp >= "2026-03-01")'`
- Pipe results to the agent for summarization: search → extract → summarize pattern
- Combine with memory files for comprehensive recall: session-logs for raw transcripts, MEMORY.md for curated insights
- Use `--json` output from rg for machine-readable search results
- Create a cron job that periodically indexes session logs into a searchable summary
- Filter by role to find only your messages or only assistant responses
Known Issues & Gotchas
- Requires jq and rg (ripgrep) installed — both are standard developer tools but not always pre-installed
- Session log files can grow large over time — searches on months of history may be slow
- JSONL format means one JSON object per line — standard JSON parsers won't work, you need jq's streaming mode
- Only searches local session files — won't find conversations from other devices or remote sessions
- Historical sessions may have different schema versions — older logs might lack some metadata fields
- Content search is text-based, not semantic — you need to know the right keywords to search for
- Session files may contain sensitive conversation data — be careful about exposing search results in shared contexts
Alternatives
- MEMORY.md / memory files
- memory_search tool
- grep / ripgrep (manual)
- SQLite session database
Community Feedback
The session-logs skill lets your agent search its own past conversations using jq. Really useful when you need to find what was discussed previously without scrolling through chat history.
— AnswerOverflow (OpenClaw Discord)
Session Logs: Search and analyze your own session logs (older/parent conversations) using jq. Query conversation history stored in JSONL files.
— GitHub (awesome-openclaw-skills)
I didn't even know my agent could search its own past sessions. The session-logs skill is low-key one of the most useful bundled skills for long-running setups.
— Reddit r/openclaw
Configuration Examples
Search for a topic across sessions
# Find all mentions of 'API design' in session logs
rg 'API design' ~/.openclaw/sessions/ --json | jq '.data.lines.text'Extract messages by date range
# Get all messages from a specific date
cat ~/.openclaw/sessions/*.jsonl | \
jq -r 'select(.timestamp >= "2026-03-15" and .timestamp < "2026-03-16") | .content'Find user-only messages
# Extract only user messages (not assistant)
cat ~/.openclaw/sessions/session-id.jsonl | \
jq -r 'select(.role == "user") | "[\(.timestamp)] \(.content[:100])"'Installation
# Built-in (bundled with OpenClaw)Source: bundled