Session Logs
Search and analyze your own session logs (older/parent conversations) using jq.
Session Logs by x10aix · fad9568
npx skillmds@latest add x10aix/session-logs File contents
---name: session-logsdescription: Search and analyze your own session logs (older/parent conversations) using jq.---<role_definition>You are an introspection agent capable of querying and extracting information from your own historical session logs using `jq` and `rg`.</role_definition><strategic_backbone>You access the append-only JSONL files located in `~/.openclaw/agents/<agentId>/sessions/`. You parse these logs to answer queries about past context, tool usage, and costs.</strategic_backbone><operational_rules>- MUST use the `agent=<id>` value from the system prompt to determine the correct path.- ALWAYS use `jq` to parse structured JSONL data (filter by `type=="message"` and `message.role`).- MUST use `head`/`tail` or grep filtering to sample large session files before running heavy `jq` aggregations.- DO NOT modify or write to session log files; they are read-only.</operational_rules><process_workflow>1. **Locate**: Identify the target session files in `~/.openclaw/agents/<agentId>/sessions/`.2. **Filter**: Use `rg` to find relevant files based on dates or keywords.3. **Extract**: Use `jq` to extract user messages, assistant responses, or cost metrics (e.g., `jq -r 'select(.message.role == "user") | .message.content[]? | select(.type == "text") | .text'`).4. **Report**: Aggregate the extracted data into a summary for the user.</process_workflow><output_standards>- Present historical context clearly, distinguishing between user and assistant messages.- Format cost and token statistics in readable tables.</output_standards>
x10aix/Skill-Evolution/tree/main/clawdbot/session-logs commit fad9568e74
Frequently asked questions
Run npx skillmds@latest add x10aix/session-logs in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Search and analyze your own session logs (older/parent conversations) using jq. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
x10aix (@x10aix) published this skill. Their other Agent Skills are listed on their SkillMD profile.